|
| 1 | +--- |
| 2 | +id: RUST-BUG-072 |
| 3 | +title: Do not expire queued connected-server source requests before dispatch |
| 4 | +status: done |
| 5 | +priority: Major |
| 6 | +category: bug |
| 7 | +workflow: local |
| 8 | +--- |
| 9 | + |
| 10 | +# RUST-BUG-072: Do not expire queued connected-server source requests before dispatch |
| 11 | + |
| 12 | +## Problem |
| 13 | + |
| 14 | +The post-`RUST-BUG-071` hide.me live-wire runs stayed VPN-bound, HighID, and |
| 15 | +Kad-connected, but failed to complete a payload. Packet and daemon logs showed |
| 16 | +that most started downloads never reached direct peers because connected-server |
| 17 | +source requests timed out at the caller while waiting in the background-session |
| 18 | +queue: |
| 19 | + |
| 20 | +- `rust-hideme-20260618T201235Z`: 18 |
| 21 | + `timed out waiting for ED2K background source response after 15s` failures. |
| 22 | +- `rust-hideme-20260618T202723Z`: 35 caller-side 15-second source-response |
| 23 | + timeouts plus one in-session `OP_FOUNDSOURCES` timeout. |
| 24 | + |
| 25 | +eMuleBB MFC buffers local server source requests into TCP frames in |
| 26 | +`DownloadQueue.cpp` and later accepts `OP_FOUNDSOURCES` asynchronously in |
| 27 | +`ServerSocket.cpp`. It does not start a per-file source-response timeout before |
| 28 | +the request is dispatched on the connected server session. Rust used the same |
| 29 | +15-second timeout both inside the session driver and around the caller's |
| 30 | +oneshot wait, so concurrent downloads could expire before their request was |
| 31 | +even sent. |
| 32 | + |
| 33 | +## Acceptance |
| 34 | + |
| 35 | +- [x] Connected-server source requests still carry a timeout used after dispatch. |
| 36 | +- [x] Waiting in the background-session queue does not consume the dispatch |
| 37 | + timeout. |
| 38 | +- [x] Cancellation still aborts the caller wait promptly. |
| 39 | +- [x] Focused unit coverage proves a queued source request can wait longer than |
| 40 | + its dispatch timeout before being answered. |
| 41 | +- [x] The next hide.me live-wire diagnostics run shows fewer caller-side |
| 42 | + connected-server source timeouts and more source acquisition opportunity. |
| 43 | + |
| 44 | +## Implementation Notes |
| 45 | + |
| 46 | +- Keep keyword searches unchanged; user-facing keyword searches still need a |
| 47 | + caller-visible timeout. |
| 48 | +- This fix only changes connected-server source lookup queue semantics. It does |
| 49 | + not increase server request rate or add new server login sessions. |
| 50 | + |
| 51 | +## Evidence |
| 52 | + |
| 53 | +- `cargo test -p emulebb-ed2k background_source_search_waits_while_queued_before_dispatch --locked` |
| 54 | +- `cargo test -p emulebb-ed2k background_source_search_cancel_stops_queued_wait --locked` |
| 55 | +- `cargo test -p emulebb-ed2k background_source_search_channel_round_trips_results --locked` |
| 56 | +- `cargo test -p emulebb-ed2k background_udp_source_search_preserves_responding_server --locked` |
| 57 | +- `python tools\rust_quality_gate.py quick` |
| 58 | +- Diagnostics build |
| 59 | + `EMULEBB_WORKSPACE_OUTPUT_ROOT\logs\builds\20260618T210610Z-build-clients\build-result.json`: |
| 60 | + Release diagnostics build passed with zero warnings. |
| 61 | +- Live-wire hide.me diagnostics run |
| 62 | + `EMULEBB_WORKSPACE_OUTPUT_ROOT\live-wire\rust-hideme-20260618T210709Z\report.json`: |
| 63 | + VPN-bound HighID run passed, started 17 downloads, completed 4 files |
| 64 | + (5388230 bytes total), reached 32 peak reported sources, stayed Kad-connected |
| 65 | + with 70 contacts, and captured packet diagnostics (5491 diagnostic records, |
| 66 | + 968 ED2K packet records, 4609 Kad UDP packet records). |
| 67 | +- Source-acquisition comparison: |
| 68 | + `rust-hideme-20260618T201235Z` had 18 caller-side |
| 69 | + `timed out waiting for ED2K background source response after 15s` failures, |
| 70 | + 8 direct attempts, and 0 completed files. `rust-hideme-20260618T202723Z` had |
| 71 | + 35 caller-side source-response timeouts, 14 direct attempts, and 0 completed |
| 72 | + files. The fixed run had 0 caller-side source-response timeouts, 29 direct |
| 73 | + attempts, 4 completed files, and retained the RUST-BUG-071 scheduler fix |
| 74 | + (`reason=direct_sources_deferred` remained 0). |
0 commit comments