Repository navigation
Mojolicious 9.54: premature connection close of the user agent, finish of the daemon, the method of the environment, and streamed responses of Pyjo.App.WSGI - #616
Merged
Conversation
…se in one context of contextvars A WSGI server gives them one thread, where the callbacks of the event loop of asyncio each run in a context of their own: the iterator of stream_with_context of Flask resets its context variables at its end with the tokens of its start, which raised ValueError in another context, so that the connection of a streamed response closed before its last chunk, which the user agent took for the end of the response until Mojolicious 9.54. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…its connection The event loop of the server that runs the application, which is the singleton, or one of its own, as of the server of a blocking request of a user agent, where a step on the singleton, which waits for the blocking request, never came, so that the response ended without its last chunk. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… 9.54 - Pyjo.UserAgent: a response that is not complete when its connection closes is a premature connection close, also after its start-line, unless its body is delimited by the close of the connection, as RFC 9112 says, or the user agent closes it itself, and the finish events see the error (e6d5a54f0). - Pyjo.Server.Daemon: the cleanup of the server with active connections emits the finish events of their transactions (60624d154). - Pyjo.Message.Request: a method of the environment that is defined, also an empty one, as a method and a query of "0" are true in Python already (8b0dbdf72). Part of #408 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Documentation build overview
3 files changed± api/Pyjo_Message_Request.html± api/Pyjo_Server_Daemon.html± api/Pyjo_UserAgent.html |
Contributor
Docker Smoke Test
|
Contributor
Tests
|
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.
The synchronization with Mojolicious 9.54, of
v9.53..v9.54, and two defects ofPyjo.App.WSGIthat its stricter user agent showed.Mojolicious 9.54
Pyjo.UserAgent(e6d5a54f0), which came after the list of the issue: a response that is not complete when its connection closes is a premature connection close also after its start-line, unless its body is delimited by the close of the connection, as RFC 9112 says, or the user agent closes it itself in_cleanup, and the finish events of the transaction and of the response see the error.Pyjo.Server.Daemon(60624d154): the cleanup of the server with active connections removes them with_remove, which emits the finish events of their transactions.Pyjo.Message.Request(8b0dbdf72): a method of the environment that is defined, also an empty one; a method and a query of"0"are true in Python already, so only the empty method changes, with a test of its own, as Mojolicious has none.t/mojo/user_agent.tandt/mojo/daemon.tare ported one for one, and fail without the change.Pyjo.App.WSGI
The user agent accepted a streamed response whose connection closed before its last chunk; two defects ended them so:
contextvars, as on a WSGI server, where the callbacks of the event loop of asyncio each run in a context of their own: the iterator ofstream_with_contextof Flask resets its context variables at its end with the tokens of its start, which raisedValueError, so that a streamed response of Flask closed its connection before its last chunk.t/servers/Mount.pyshowed it, andt/Pyjo/App_WSGI.pyhas a test of it without Flask.t/Pyjo/App_WSGI.pyshowed it onPyjo.Reactor.Poll.Pyjo.App.CGI,Pyjo.App.FastCGIandPyjo.App.ASGIschedule on the singleton too; no test shows it under the server of a blocking request, so they stay as they are.Validation
Pyjo.Reactor.PollwithPYTHONDEVMODE=1, without aResourceWarningor an unhandled rejected promiset/serverson Python 3.15 and 3.12-W,trunk checkCloses #408
🤖 Generated with Claude Code