-
Notifications
You must be signed in to change notification settings - Fork 536
fix: Data leak in ThreadingIntegration between threads #4281
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
Merged
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
7d14008
Some test showing trx in trx is a bad idea
antonpirker 9c35e83
test that shows we are leaking scope changes
antonpirker 664f0e0
remove flaky tests, it does more harm then it helps
antonpirker 0d9a221
better readability
antonpirker 0100bdb
better readable
antonpirker bd44959
Propagate a copy of the scopes to threads
antonpirker 0e92608
More tests
antonpirker fd69f64
better span names
antonpirker e4d94a5
what is happening?
antonpirker c7af4b9
back to forking
antonpirker 678f515
trigger ci
antonpirker eef7ff6
trying without new tests
antonpirker 518dc04
Revert all the changes
antonpirker 24ea433
Trying somethign
antonpirker 0d5b3fb
Reenable tests
antonpirker d3585a3
cleanup
antonpirker 5bcba35
trying test forking
antonpirker 4c2f7d9
Removed some stuff again
antonpirker 890640f
commented wrong lines
antonpirker 957d7bb
does it work in django 3.0?
antonpirker 07d44c9
no channels in django 3.0
antonpirker 2a2cde1
trying without channels
antonpirker 8cd789b
No channels for newer Django versions
antonpirker 6982479
Warning
antonpirker 3b85ef4
Better error message
antonpirker e783af9
.
antonpirker 160e430
checking for warning
antonpirker 8cd1584
Merge branch 'master' into antonpirker/threading-tests
antonpirker 9aad099
linting
antonpirker 0da1c2e
explanation
antonpirker 096579e
Revert tox to version in master
antonpirker 33d9f3d
Merge branch 'master' into antonpirker/threading-tests
antonpirker 815e930
Better checks and importing only once
antonpirker 5d306ee
Merge branch 'antonpirker/threading-tests' of github.com:getsentry/se…
antonpirker 8aa5edf
Better check
antonpirker ca8aa30
Merge branch 'master' into antonpirker/threading-tests
antonpirker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
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.
Since this is happening in
Thread.start
, we might log this even if a thread is started outside of Django -- but I don't think we have a way of detecting that. And since this iswarnings.warn
message, it should only be printed once and not spam on everyThread.start
, so hopefully this is fine.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.
the problem with the unawaited future is only happening if old python, django and channels are used in combination. on a vanilla python project on old python versions the threading works fine.
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.
Yeah, my point was more that someone might have Django/channels installed in their venv but uses threads in an unrelated script that has nothing to do with their Django app and they would get this warning too. But as said, I don't see a way around this
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.
now I get it. yes that is true. but as you said, the warning is only emitted once, so I think it is ok.