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

Lock for the duration of tool commands #4720

Merged
merged 1 commit into from
Jul 10, 2024
Merged

Lock for the duration of tool commands #4720

merged 1 commit into from
Jul 10, 2024

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented Jul 2, 2024

Feedback from #4501 (comment)

@zanieb zanieb added enhancement New feature or improvement to existing functionality preview Experimental behavior labels Jul 2, 2024
@zanieb zanieb requested review from charliermarsh and konstin July 2, 2024 02:44
@zanieb zanieb marked this pull request as ready for review July 2, 2024 02:45
@zanieb
Copy link
Member Author

zanieb commented Jul 2, 2024

Ah this is a bit annoying because now we're locking the directory before we make sure it exists, which I preferred to have happen once we knew we wanted to mutate it so we weren't creating during inspection. I'm not sure how much this matters in practice.

@charliermarsh
Copy link
Member

Ah this is a bit annoying because now we're locking the directory before we make sure it exists, which I preferred to have happen once we knew we wanted to mutate it so we weren't creating during inspection. I'm not sure how much this matters in practice.

Where is this happening in the code? I think it's ok though.

@zanieb
Copy link
Member Author

zanieb commented Jul 2, 2024

@charliermarsh you can see the CI failures are due to the lock being acquired without init first which throws an error. Previously, we waited to call init until we needed do something.

@charliermarsh
Copy link
Member

Ahh sorry yes, that makes sense.

Copy link
Member

@BurntSushi BurntSushi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My little nit here is to use a different word than "safe" in the comments, just to avoid it being confusable with the Rust concept of safety. Maybe, "correct" instead?

@zanieb zanieb enabled auto-merge (squash) July 10, 2024 16:14
@zanieb zanieb merged commit f3c5d26 into main Jul 10, 2024
49 checks passed
@zanieb zanieb deleted the zb/tool-lock branch July 10, 2024 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement to existing functionality preview Experimental behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants