node: upload-pack inter-thread communication
If an upload-pack is of a considerable size, the writer thread will be busy writing bytes to the receiving side. During this period, the receiving side will not be sending any bytes.
To ensure that the reader does not exit while the writing thread is performing writes, the reading side will check when the last time a write was performed. If it has not reached the timeout, then it can continue attempting to read. Otherwise, it will break out of the loop; killing the upload-pack process safely.
1 file changed
+33
-12
ce8ac663
→
6dcd5627
modified radicle-node/src/worker/upload_pack.rs
@@ -1,5 +1,5 @@
|
|
| - | |
| + | |
|
|
|
|
|
@@ -86,17 +86,28 @@ where
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -116,11 +127,14 @@ where
|
|
|
|
|
|
| - | |
| - | |
|
|
|
|
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -154,6 +168,7 @@ struct Reporter<W> {
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -164,9 +179,14 @@ impl<W> Reporter<W> {
|
|
|
|
|
|
| + | |
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -203,6 +223,7 @@ where
|
|
|
|
|
|
| + | |
|
|
|
|
|