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

Calling t.w.s.Request.getSession uses the global reactor #10177

Closed
twisted-trac opened this issue Apr 14, 2021 · 4 comments
Closed

Calling t.w.s.Request.getSession uses the global reactor #10177

twisted-trac opened this issue Apr 14, 2021 · 4 comments

Comments

@twisted-trac
Copy link

twm's avatar @twm reported
Trac ID trac#10177
Type defect
Created 2021-04-14 05:13:19Z
Branch https://github.com/twisted/twisted/tree/getsession-global-reactor-10177

twisted.web.server.Request.getSession() calls self.sessionFactory to create a session. This is the same as calling twisted.web.server.Session, which accepts a reactor parameter. However, getSession() doesn't pass this parameter, which defaults to the global reactor.

Calling Request.getSession() should use the reactor associated with the Site.

This causes use of Treq's StubTreq to touch the global reactor: https://github.com/twisted/treq/pull/328/files#r612941248

Searchable metadata
trac-id__10177 10177
type__defect defect
reporter__twm twm
priority__normal normal
milestone__None None
branch__getsession_global_reactor_10177 getsession-global-reactor-10177
branch_author__ 
status__closed closed
resolution__fixed fixed
component__web web
keywords__None None
time__1618377199514312 1618377199514312
changetime__1621404600973630 1621404600973630
version__None None
owner__twm twm

@twisted-trac
Copy link
Author

twm's avatar @twm set owner to @twm
@twm set status to assigned

PR: #1587

@twisted-trac
Copy link
Author

twm's avatar @twm removed owner
@twm set status to new

@twisted-trac
Copy link
Author

wsanchez's avatar @wsanchez set owner to @twm

@twisted-trac
Copy link
Author

twm's avatar @twm set status to closed

In changeset cae3652

#!CommitTicketReference repository="" revision="cae365213868e8226a055f6b5e4d2c0c89c9ab3b"
Merge pull request #1587 from twisted/getsession-global-reactor-10177

Author: twm
Reviewer: wsanchez
Fixes: ticket:10177

Sessions: use the site reactor, not the global one

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

No branches or pull requests

2 participants