Better error handling in HTTP
Dependencies
- [2]
6FEU6ES7Fixing network errors - [3]
AI73GKAOAdding a UserAgent header to the http downloader - [4]
L2VH4BYKDownloading changelists from channels without an id (Nest discussions) - [5]
HKA66XOQUpdating Thrussh version for long or massive connections - [6]
TPEH2XNB1.0.0-alpha.28, with Tokio 1.0 - [7]
4CEHBW7YTruncate files when restarting a HTTP transfer - [8]
FYUDBQ3CFormatting changes + version bump - [9]
VBMXB443Retrying if the HTTP connection drops while reading the body - [10]
FBXYP7QMForgot to add remote::http - [11]
HSVGP2G4Version bump + formatting - [12]
SAGSYAPXVarious version bumps - [13]
XAY4DYRRVersion bump - [14]
ZTVNGFNTVersion bump - [15]
VRDOV7DDVersions - [16]
FDPGJDXVCompiling Thrussh with feature OpenSSL by default - [17]
BVVMTOYWProper renaming of changes downloaded over HTTP - [18]
JACZWIJ6Version bump - [19]
6DOXSHWGCleanup, and version bump - [20]
OUWD436AVersion bump - [21]
I6DVZEFUDo not ask for user input if the SSH channel is already closed - [22]
R4RRU65VRecreate the patch file instead of only truncating it, on failed HTTP downloads - [23]
YX3VCEOMVersion bump - [24]
5BRU2RRWCleanup (debugging a crash related to trees/inodes) - [25]
367UBQ6KForwarding SSH stderr, and progress bar for push - [26]
B3QWIGDEFixing the Git features with the latest Pijul (+ conflicts in Cargo.toml) - [27]
WIORLB47Version bump - [28]
CCLLB7OIUpgrading to Sanakirja 0.15 + version bump - [29]
ENKQ3QZGForward the exit status messages from the SSH background loop to the client (solving hangs) - [30]
VYHHOEYHVersions and formatting - [31]
MU5GSJAWPartial push and pull (WARNING: breaks the existing protocol) - [32]
IQ4FCHPZHTTP connections: pooling + retry on error - [33]
HDGRZISMVersion updates - [34]
OCBM7IFENew release: pijul-1.0.0-alpha.8 - [35]
3S4DR77ZVersion updates - [36]
H565UUPCUse correct pattern for workspace interdependencies - [37]
GBSL4AZIVersion bump - [38]
G6YZ7U65Version bump - [39]
JL4WKA5PImplement the Sanakirja concurrency model in a cross-process way - [40]
UN64Q3P2Version bump - [41]
NX5I5H53New published versions - [42]
JRENVH5DReqwest 0.11 - [43]
SXEYMYF7Fixing the bad changes in history (unfortunately, by rebooting). - [44]
G65S7FAWVersion bump and cleanup - [45]
IIV3EL2XCleanup, formatting, and fixing the Git feature - [46]
WI5BS6BSNew published versions - [47]
Q45QHPO4Feedback on network stuff - [48]
CUHXXBDZFixing a bug in replacements, recently introduced during a fix of a graph corruption bug - [*]
V435QOJRUsing path-slash to fix path issues on Windows - [*]
2K7JLB4ZNo pager on Windows - [*]
QJXNUQFJSolving conflicts
Change contents
- replacement in pijul/src/remote/http.rs at line 8
use log::{debug, error};use log::{debug, error, trace}; - replacement in pijul/src/remote/http.rs at line 28
let mut f = std::fs::File::create(&path_)?;let mut f = tokio::fs::File::create(&path_).await?; - replacement in pijul/src/remote/http.rs at line 33
loop {let (send, mut recv) = tokio::sync::mpsc::channel::<Option<bytes::Bytes>>(100);let t = tokio::spawn(async move {while let Some(chunk) = recv.recv().await {match chunk {Some(chunk) => {trace!("writing {:?}", chunk.len());use tokio::io::AsyncWriteExt;f.write_all(&chunk).await?;}None => {f.set_len(0).await?;}}}Ok::<_, std::io::Error>(())});let mut done = false;while !done { - replacement in pijul/src/remote/http.rs at line 64
f.set_len(0)?;send.send(None).await?; - replacement in pijul/src/remote/http.rs at line 70
bail!("HTTP error {:?}", res.status())tokio::time::sleep(std::time::Duration::from_secs_f64(delay)).await;send.send(None).await?;delay *= 2.;continue; - replacement in pijul/src/remote/http.rs at line 75
let done = loop {while !done { - replacement in pijul/src/remote/http.rs at line 77[6.137]→[6.294:448](∅→∅),[6.1261]→[6.294:448](∅→∅),[6.294]→[6.294:448](∅→∅),[6.448]→[6.39:79](∅→∅),[6.79]→[6.490:593](∅→∅),[6.490]→[6.490:593](∅→∅)
Ok(Some(chunk)) => {debug!("writing {:?}", chunk.len());f.write_all(&chunk)?;}Ok(None) => break true,Err(_) => {error!("Error while downloading {:?}, retrying", url);Ok(Some(chunk)) => send.send(Some(chunk)).await?,Ok(None) => done = true,Err(e) => {debug!("error {:?}", e);error!("Error while downloading {:?} from {:?}, retrying", c32, url);send.send(None).await?; - replacement in pijul/src/remote/http.rs at line 85
break false;break; - edit in pijul/src/remote/http.rs at line 88
};if done {std::fs::rename(&path_, &path_.with_extension("change"))?;break; - edit in pijul/src/remote/http.rs at line 90
std::mem::drop(send);t.await??;if done {std::fs::rename(&path_, &path_.with_extension("change"))?;} - replacement in pijul/Cargo.toml at line 63
tokio = { version = "1.0", features = [ "rt-multi-thread", "macros", "sync" ] }tokio = { version = "1.0", features = [ "rt-multi-thread", "macros", "sync", "fs" ] } - edit in pijul/Cargo.toml at line 90
bytes = "1.0" - edit in Cargo.lock at line 1511[52.33594][52.33594]
"bytes",