-
-
Notifications
You must be signed in to change notification settings - Fork 844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drop run
and run_in_threadpool
#710
Conversation
Yes, I remember server restarts have already been the cause of some headaches in the past… #276 (comment) As far as understanding the error message, it's already been discussed in #96 — basically the server abruptly closed the connection (which it did). We're making a blocking call in the main thread via Actually, if we turn Luckily, we have an agnostic Lemme push a commit to demonstrate the idea… |
ef7625a
to
83612a1
Compare
Note that these connection pool tests run faster now, because we don't have to setup/teardown a thread on each restart. 😄 |
83612a1
to
1186d66
Compare
@florimondmanca Thanks, great stuff! I've now also dropped Also cleaned up the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
We're no longer using the backend methods
run
andrun_in_threadpool
within thehttpx
codebase, so this PR removes them.We are however using them within the test cases in order to perform the server restarts.
I've changed things around so that
.restart()
is a standard blocking function (It may as well be, and it runs from a different thread from the server, so it won't block the server itself from shutting down.)However, the tests that use
server.restart()
are currently failing in theasyncio
case. (With h11 errors that the server close event is occuring at a point that it should not.) Really not clear to me why we'd see that with asyncio but not with trio. I think that are resolution here might be that restart should perform a full shutdown, and reopen the server on an entirely new thread, to keep things cleaner?Any thoughts on this @florimondmanca?