Let a signal abort a send queued behind a full send window (#90)

* Regression tests for aborting a send queued behind a full window

* Let a signal abort a send queued behind a full send window

* Log a queued send, tighten its regression tests and settle the decision record

* Take the send window's queue off an array so an abort cannot stall the loop

---------

Co-authored-by: Mikael Göransson <mikael.goransson@timewave.se>
This commit is contained in:
2026-09-06 18:17:01 +02:00
committed by GitHub
parent 0a7c491e55
commit 30eedc81ee
7 changed files with 243 additions and 17 deletions
+4 -2
View File
@@ -48,7 +48,7 @@ export class OutgoingRequests {
this.pending = new PendingRequests(options.log);
this.responseTimeout = options.responseTimeout;
this.transport = options.transport;
this.window = new SendWindow(options.maxOutstanding);
this.window = new SendWindow({ limit: options.maxOutstanding, log: options.log });
}
/** Read through a method: a drop can land while a request is awaiting. */
@@ -115,7 +115,9 @@ export class OutgoingRequests {
if (held.err) return { err: held.err };
await this.window.acquire();
const slot = await this.window.acquire(options.signal);
if (slot.err) return { err: slot.err };
const attempt = await this.attempt(input, options).finally(() => { this.window.release(); });