Repository navigation
Conversation
…wered, against a fast API that closes its connections An API answering in HTTP/1.1 with Connection: close after most replies makes RESTest open a connection per request; on macOS the local ports run out within 17 to 19 seconds and the run then nearly stops for up to fifteen seconds every half minute, its unsent requests counted under no reply. The known limitations said HTTP/1.1 was not affected; they now say it is, how to see it in the report's timeline, and what a rate below the ports' limit costs. The troubleshooting chapter points there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: None
What you can do now that you could not before
You can tell, from the known limitations, why a run against a fast API that closes its connections
nearly stops about every half minute and shows thousands of requests with
no replythe API neversaw, what that means for the run, and what keeping clear of it costs. Until now the page said that
an API answering in HTTP/1.1 was not affected by the connections it closes; measured before 2.5.0,
it is.
Try it yourself
The change is one entry of a page and a pointer to it from the manual:
To see the limitation itself you need an API that answers thousands of requests a second and closes
the connection after most replies. Its run's timeline shows the stretches, with nothing stored:
How it works
A connection is the line between RESTest and the API. An API may say, in HTTP/1.1, that it will hang
up after a reply (
Connection: close); many servers do so after a400or a500. RESTest then opensa new line for the next request, and against an API that answers in a millisecond or two that is
thousands of new lines a second. A line RESTest lets go before the API has hung up keeps one of the
machine's local addresses (ports) busy for half a minute or more; once none is left, the next
requests cannot even be sent until the first come free. They fail on the machine itself, are counted
under
no reply, and make the run slow down as if the API had stopped answering.The entry says that, how much it cost on two real APIs, how to see it in the report and why it shows
up in stretches, and what
engine.mostRequestsPerMinutecan do about it and at what price. Thetroubleshooting chapter's "The API falls over under the run", where a reader with thousands of
no replylands, now points there: its first advice, one request at a time, does not help here.What changed in the code
Nothing.
docs/known-limitations.md: one new entry under "What a run says", and the last sentence ofthe HTTP/1.0 entry before it.
docs/manual/10-troubleshooting.md: one paragraph.Evidence
Tests: none added, two pages only.
Architecture tests: unchanged — none weakened. The architecture and documentation rules,
./mvnw -q verify -pl restest-arch-tests -am -Dtest='io.restest.arch.**': 162, none failed(the links to
report.md#timelineandknown-limitations.md#what-a-run-saysamong them).Mutation score: not applicable.
Per-request overhead: not applicable.
Smoke run, two containerised APIs: not applicable, no code changed.
Idle time: not applicable.
Artefact: the measurements behind the entry, on macOS (by default 16,384 local ports,
49152–65535, each kept 30 s), with the release candidate, master
50f1e912, three minutes, everyrequest stored:
BindExceptionConnection: close400, 71% of its replies500and400Every request that failed in these two runs failed this way, after a median of 0.43 ms. Read in
3-second slices, most requests got no reply in stretches of 6 to 15 seconds that began every 30 to
33 seconds (cwa-verification at 18, 51, 81, 114, 144 and 177 s; erc20-rest-service at 21, 51, 84,
117 and 150 s). 80,000 and 114,000 connections were closed before the ports ran
out, so only some of them keep a port. Each stored run took 1.6 GB. 2.2.0 and 2.4.0 lose these
requests too: it is no regression of 2.5.0.
Decisions taken
would be the one Get a reply to every request from an API that answers in HTTP/1.0, as Python's http.server does #436 made for HTTP/1.0: end outright (
SO_LINGER 0) a connection whose replycloses it, so that no port waits after it, for
Connection: closein HTTP/1.1 too. It would changewhat every run against such an API sends, so it needs measuring on its own.
waits, and whether a waiting one can be reused for a new connection differ by system and setting;
the entry gives the rule (ports ÷ seconds each is kept × 60) and macOS's figure, where it was
measured, and nothing unmeasured for Linux or Windows.
would cut a run against those APIs to about an eighth of the requests they answered even with the
losses, so the entry now leads with reading the
no replyas the machine's, and gives the ratelast, with that cost. The same review found that the first draft said every closed connection keeps
a port, which the runs contradict, that it pointed to
--store(1.6 GB here) where the report'stimeline shows the same, and that the troubleshooting chapter did not lead to the entry; all four
are changed.
Open questions
None.
masterAGENTS.mdhold🤖 Generated with Claude Code