Skip to content

Prevent deadlocks resulting from errors thrown before releasing mutex#195

Merged
Gudahtt merged 1 commit intodevelopfrom
prevent-deadlocks
Jan 24, 2020
Merged

Prevent deadlocks resulting from errors thrown before releasing mutex#195
Gudahtt merged 1 commit intodevelopfrom
prevent-deadlocks

Conversation

@Gudahtt
Copy link
Copy Markdown
Member

@Gudahtt Gudahtt commented Jan 24, 2020

A try ... finally block has been added to most places where a mutex is used, to ensure that any error thrown before the lock has been released will not result in a deadlock.

The finally block will execute after the try block, but it will not interfere with any returned values or thrown errors (so long as nothing is thrown or returned within the finally block).

Copy link
Copy Markdown
Member

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

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

LGTM.

This is a really important change.

A `try ... finally` block has been added to most places where a mutex
is used, to ensure that any error thrown before the lock has been
released will not result in a deadlock.

The `finally` block will execute after the `try` block, but it will
not interfere with any returned values or thrown errors (so long as
nothing is thrown or returned within the `finally` block).
Copy link
Copy Markdown
Contributor

@estebanmino estebanmino left a comment

Choose a reason for hiding this comment

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

👌

Copy link
Copy Markdown
Contributor

@whymarrh whymarrh left a comment

Choose a reason for hiding this comment

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

Split diff with no whitespace changes is the real MVP here:

Diff settings on GitHub, show split diff selected with whitespace changes hidden

@rekmarks
Copy link
Copy Markdown
Member

Split diff with no whitespace changes is the real MVP here:

/giphy gandalf crying

@Gudahtt Gudahtt merged commit 984ab10 into develop Jan 24, 2020
@Gudahtt Gudahtt deleted the prevent-deadlocks branch January 24, 2020 20:48
whymarrh pushed a commit to whymarrh/gaba that referenced this pull request Jan 24, 2020
…MetaMask#195)

A `try ... finally` block has been added to most places where a mutex
is used, to ensure that any error thrown before the lock has been
released will not result in a deadlock.

The `finally` block will execute after the `try` block, but it will
not interfere with any returned values or thrown errors (so long as
nothing is thrown or returned within the `finally` block).
@whymarrh whymarrh mentioned this pull request Jan 24, 2020
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
…#195)

A `try ... finally` block has been added to most places where a mutex
is used, to ensure that any error thrown before the lock has been
released will not result in a deadlock.

The `finally` block will execute after the `try` block, but it will
not interfere with any returned values or thrown errors (so long as
nothing is thrown or returned within the `finally` block).
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
…#195)

A `try ... finally` block has been added to most places where a mutex
is used, to ensure that any error thrown before the lock has been
released will not result in a deadlock.

The `finally` block will execute after the `try` block, but it will
not interfere with any returned values or thrown errors (so long as
nothing is thrown or returned within the `finally` block).
Mrtenz pushed a commit that referenced this pull request Oct 16, 2025
Bumps [@metamask/utils](https://github.com/MetaMask/utils) from 3.4.1 to 3.5.0.
- [Release notes](https://github.com/MetaMask/utils/releases)
- [Changelog](https://github.com/MetaMask/utils/blob/main/CHANGELOG.md)
- [Commits](MetaMask/utils@v3.4.1...v3.5.0)

---
updated-dependencies:
- dependency-name: "@metamask/utils"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants