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

fix(console): prevent deadlock in author new --switch #2032

Conversation

divagant-martian
Copy link
Contributor

Description

Fixes #2024

This was caused by a read attempt over a lock nested inside a write lock. Thw write lock being let mut inner = self.0.write() and the read lock in self.iroh_data_dir()

Notes & open questions

I checked the rest of the code in #2013 and I think author new --switch is the only command affected

Change checklist

  • Self-review.
  • Documentation updates if relevant.
  • Tests if relevant.

Copy link
Contributor

@dignifiedquire dignifiedquire left a comment

Choose a reason for hiding this comment

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

the beauty of locks..

@divagant-martian divagant-martian added this pull request to the merge queue Feb 17, 2024
Merged via the queue into n0-computer:main with commit fea92ac Feb 17, 2024
19 checks passed
fubuloubu pushed a commit to ApeWorX/iroh that referenced this pull request Feb 21, 2024
…2032)

## Description

Fixes n0-computer#2024

This was caused by a read attempt over a lock nested inside a write
lock. Thw write lock being `let mut inner = self.0.write()` and the read
lock in `self.iroh_data_dir()`

## Notes & open questions

I checked the rest of the code in n0-computer#2013 and I think `author new
--switch` is the only command affected

## Change checklist

- [ ] Self-review.
- [ ] Documentation updates if relevant.
- [ ] Tests if relevant.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

bug: in the console author new --switch hangs
2 participants