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 (and test) for a deadlock that can happen while waiting for protocol info #12633

Merged

Conversation

devyn
Copy link
Contributor

@devyn devyn commented Apr 23, 2024

Description

The local socket PR introduced a Waitable type, which could either
hold a value or be waited on until a value is available. Unlike a
channel, it would always return that value once set.

However, one issue with this design was that there was no way to detect
whether a value would ever be written. This splits the writer into a
different type WaitableMut, so that when it is dropped, waiting
threads can fail (because they'll never get a value).

Tests + Formatting

A test has been added to stress_internals to make sure this fails in
the right way.

  • 🟢 toolkit fmt
  • 🟢 toolkit clippy
  • 🟢 toolkit test
  • 🟢 toolkit test stdlib

…col info

The local socket PR introduced a `Waitable` type, which could either
hold a value or be waited on until a value is available. Unlike a
channel, it would always return that value once set.

However, one issue with this design was that there was no way to detect
whether a value would ever be written. This splits the writer into a
different type `WaitableMut`, so that when it is dropped, waiting
threads can fail (because they'll never get a value).

A test has been added to `stress_internals` to make sure this fails in
the right way.
@fdncred fdncred added the pr:plugins This PR is related to plugins label Apr 24, 2024
@fdncred fdncred merged commit c52884b into nushell:main Apr 24, 2024
15 checks passed
@fdncred
Copy link
Collaborator

fdncred commented Apr 24, 2024

thanks

@hustcer hustcer added this to the v0.93.0 milestone Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:plugins This PR is related to plugins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants