Skip to content
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

Support psgix.cleanup (and psgix.cleanup.handlers) #132

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

jrubinator
Copy link

@jrubinator jrubinator commented May 2, 2019

This PR adds psgix.cleanup* handling to Starman.

@miyagawa
Copy link
Owner

miyagawa commented May 2, 2019

probably a dupe of #53

@jrubinator
Copy link
Author

Hmm, I think you're right. Wish I'd done a better job searching for that first 😝

I'll see if I can wake up that seven-year-old PR. Assuming I can, I'm happy to close this one.

@jrubinator
Copy link
Author

@miyagawa I think that branch is too old to re-garner momentum. I'm happy to implement turning off keep-alive connections when there are cleanup handlers here, would you be okay with that?

jonrubin-gsg and others added 3 commits May 8, 2019 14:33
Implement the proposal at
https://github.com/plack/psgi-specs/wiki/Proposal:-PSGI-environment-cleanup-handlers. This
seems to work for me, at least the subroutines get run, and you can
e.g. "sleep 10" in the cleanup handler without holding up the request.

One potential caveat here is that by passing the $env hash to the
post_client_connection_hook routine we might be causing something
evil, but I haven't spotted any problems with it so far.

Note that we have to re-check the harakiri flag in
post_client_connection_hook because the cleanup handlers might set it.
(no additional testing, as keepalive behavior isn't currently tested or
easily accessible from tests).
@jrubinator
Copy link
Author

I refactored to use #53 (since that correctly handled cleanup-harakiri interaction), and added the requested keepalive handling.

@jrubinator
Copy link
Author

:(

@ArcticSnowman
Copy link

@miyagawa - any chance this can be merged into a release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants