Skip to content

Fix (and test) for a deadlock that can happen while waiting for protocol info - #12633

Merged
fdncred merged 1 commit into
nushell:mainfrom
devyn:fix-deadlock-while-waiting-on-protocol_info
Apr 24, 2024
Merged

fdncred merged 1 commit into
nushell:mainfrom
devyn:fix-deadlock-while-waiting-on-protocol_info

Conversation

@devyn

@devyn devyn commented Apr 23, 2024

Copy link
Copy Markdown
Contributor

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 deprecated:pr-plugins Deprecated: use the A:plugins label instead label Apr 24, 2024
@fdncred
fdncred merged commit c52884b into nushell:main Apr 24, 2024
@fdncred

fdncred commented Apr 24, 2024

Copy link
Copy Markdown
Contributor

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

deprecated:pr-plugins Deprecated: use the A:plugins label instead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants