forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 0
[pull] main from python:main #53
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
Conversation
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
Add a lock to ensure that only one iOS testbed per user can start at a time, so that the simulator discovery process doesn't collide between instances.
Reviewer's Guide by SourceryThis pull request addresses a memory management issue in Sequence diagram for acquiring and releasing the SimulatorLocksequenceDiagram
participant RT as RunTestbed
participant SL as SimulatorLock
participant OS as OS
RT->>SL: SimulatorLock(timeout)
RT->>SL: await acquire()
activate SL
SL->>OS: filename.touch(exist_ok=True)
loop timeout times
SL->>OS: os.open(filename, os.O_RDWR | os.O_TRUNC, 0o644)
OS-->>SL: fd
SL->>OS: fcntl.flock(fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
alt Lock acquired
OS-->>SL: Success
SL-->>RT: Return
else Lock not acquired
OS-->>SL: OSError
SL->>OS: os.close(fd)
SL->>SL: await asyncio.sleep(1)
end
end
deactivate SL
RT->>SL: release()
activate SL
SL->>OS: fcntl.flock(fd, fcntl.LOCK_UN)
SL->>OS: os.close(fd)
deactivate SL
Updated class diagram for SimulatorLockclassDiagram
class SimulatorLock {
-Path filename
-int timeout
-int fd
+__init__(timeout: int)
+acquire() : void
+release() : void
}
note for SimulatorLock "This class provides a file-based lock to prevent race conditions during iOS simulator creation."
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.1)
Can you help keep this open source service alive? 💖 Please sponsor : )
Summary by Sourcery
This pull request improves the performance of frame locals proxy lookups and adds a lock to prevent race conditions when creating iOS simulators.
Enhancements:
framelocalsproxy
lookups by avoiding redundant calls toframelocalsproxy_getval
.Documentation: