-
Notifications
You must be signed in to change notification settings - Fork 1k
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
changes to make app.current_request thread safe #1358
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1358 +/- ##
==========================================
+ Coverage 96.11% 96.12% +0.01%
==========================================
Files 28 28
Lines 5324 5342 +18
Branches 682 682
==========================================
+ Hits 5117 5135 +18
Misses 136 136
Partials 71 71
Continue to review full report at Codecov.
|
Thanks for the pull request! Reading over the discussion in #759, I'd prefer to make this change in the local mode code because it only affects local mode. |
ba6e18c
to
d6eaabf
Compare
That makes sense. I made some changes so that only code running in local mode will be affected. Unfortunately I had to resort to a bit of a hack because the |
Thanks for the update. It looks like this failed the travis build so we'll need to get that resolved before we can merge. |
331616b
to
a2e24e6
Compare
I've resolved most of the mypy issues, but I think the one remaining is actually a known bug with mypy. |
a2e24e6
to
ef3ce1f
Compare
Thanks for updating. I'd still like to see the travis build passing before merging so I'm open to ideas on how to do that. What if instead of subclassing we just had |
Yeah, I had considered that approach as well. I can give that a try. I am not sure if |
0f5f3b3
to
a3b1897
Compare
…locally - fixes race conditions that can occur when chalice is being run locally and it handling multiple concurrent requests
a3b1897
to
33e7702
Compare
Looks like things are passing now. Thanks for the suggestion! I added a basic unittest as well to satisfy codecov. |
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.
Thanks for updating! Looks good to me.
PR #1358. * thread-safe-app-current-request: Make current_request thread safe for chalice local
Merged in 417e73e |
Related Issue: #759
Wraps
app.current_request
access in adict
that is automatically keyed by the current thread's id, with each thread getting its ownapp.current_request
.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.