Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.3k
gh-109461: Update logging module lock acquisition to use context manager#109462
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
vstinner merged 41 commits intopython:mainfromdcollison:gh-109461-update-logging-lock-acquisitionSep 27, 2023
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes from1 commit
Commits
Show all changes
41 commits Select commitHold shift + click to select a range
02c1d58
Updated logging __init__.py to acquire its module lock using a contex…
dcollisonf319ab0
📜🤖 Added by blurb_it.
blurb-it[bot]6664c4c
Merge branch 'main' into gh-109461-update-logging-lock-acquisition
dcollisonfd635b2
Updated to leave the existing API alone and added a new method _acqui…
dcollison749b678
Merge remote-tracking branch 'origin/gh-109461-update-logging-lock-ac…
dcollisone5ad43b
Updated acquireLock usages to acquireModuleLock
dcollison0a2bb5f
Removed unnecessary changes
dcollisonea33592
Merge branch 'main' into gh-109461-update-logging-lock-acquisition
dcollisonaf9f7d1
Merge branch 'main' into gh-109461-update-logging-lock-acquisition
dcollison4f2d1c1
Updated _acquireModuleLock() to _get_lock() which gets the lock's con…
dcollisondc7df1e
Merge remote-tracking branch 'origin/gh-109461-update-logging-lock-ac…
dcollison892a5cb
Updated comments
dcollisona30d5da
Merge branch 'main' into gh-109461-update-logging-lock-acquisition
dcollisoncf7a2e6
Updated blurb
dcollison0a53f3b
Merge remote-tracking branch 'origin/gh-109461-update-logging-lock-ac…
dcollison2760cc5
Removed unused import
dcollisonb5e6651
Merge branch 'main' into gh-109461-update-logging-lock-acquisition
dcollison7f3b28a
Updated __init__.py to remove _get_lock() and "if _lock" checks since…
dcollison09c9133
Changed "with logging._get_lock():" to "with logging._lock:"
dcollison9f3607e
Changed "with logging._get_lock()" to "with logging._lock:"
dcollisonb15e4bf
Changed "with logging._get_lock():" to "with logging._lock:"
dcollisona0c50bf
Update __init__.py
dcollison9d0675b
Update Misc/NEWS.d/next/Library/2023-09-15-17-12-53.gh-issue-109461.V…
dcollisona298a7b
Update __init__.py
dcollison1b14732
Merge branch 'main' into gh-109461-update-logging-lock-acquisition
dcollison1979a75
Updated handlers to use a context manager for lock acquisition
dcollison3fd33ef
Updated handlers to use a context manager for lock acquisition
dcollison22c868e
Copying _lock to local variable
dcollison335f814
Updated another lock acquisition
dcollisonafa79ef
Update Misc/NEWS.d/next/Library/2023-09-15-17-12-53.gh-issue-109461.V…
dcollison600a126
Merge branch 'main' into gh-109461-update-logging-lock-acquisition
dcollison5e92580
Someone managed to duplicate a line in the docstring
dcollison20e46f6
Merge remote-tracking branch 'origin/gh-109461-update-logging-lock-ac…
dcollisonc73e2b7
Someone managed to duplicate a line in the docstring
dcollisona9472c7
Reverted Handler acquire() and release() as it actually needs the Non…
dcollisondf75801
Merge branch 'main' into gh-109461-update-logging-lock-acquisition
dcollisonbca5ae8
Added comment to _acquireLock() to justify the try-except block aroun…
dcollison1ba5979
Renamed "_acquireLock" to "_prepareFork" and "_releaseLock" to "_afte…
dcollisonc1a9651
Merge branch 'main' into gh-109461-update-logging-lock-acquisition
dcollisonefd7462
Merge branch 'main' into gh-109461-update-logging-lock-acquisition
dcollison797ae0d
Merge branch 'main' into gh-109461-update-logging-lock-acquisition
AA-TurnerFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
Updated acquireLock usages to acquireModuleLock
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
commite5ad43b7fee87a0b1136dd6925d07aade55f7151
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -260,6 +260,8 @@ def _acquireModuleLock(): | ||
try: | ||
_acquireLock() | ||
yield | ||
except BaseException: | ||
raise | ||
finally: | ||
_releaseLock() | ||
@@ -892,7 +894,7 @@ def _removeHandlerRef(wr): | ||
# set to None. It can also be called from another thread. So we need to | ||
# pre-emptively grab the necessary globals and check if they're None, | ||
# to prevent race conditions and failures during interpreter shutdown. | ||
acquire, handlers =_acquireModuleLock, _handlerList | ||
if acquire and handlers: | ||
with acquire(): | ||
dcollison marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
try: | ||
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.