Skip to content

fix(testing): recover from lock poisoning in memoized! macro to preve… - #5846

Merged
bfops merged 2 commits into
clockworklabs:masterfrom
rohanranjan0902:fix-ci-flake-poison-error
Sep 25, 2026
Merged

bfops merged 2 commits into
clockworklabs:masterfrom
rohanranjan0902:fix-ci-flake-poison-error

Conversation

@rohanranjan0902

@rohanranjan0902 rohanranjan0902 commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

This PR allows the test harness to gracefully recover from lock poisoning (Issue #5841).

Previously, if a test panicked while compiling a module inside the memoized! macro, it would poison the Mutex holding the MEMOIZED compilation cache. Any subsequent tests attempting to access the cache would panic with a PoisonError, causing unrelated tests to fail and masking the original error.

This replaces .lock().unwrap() with .lock().unwrap_or_else(|e| e.into_inner()) on the cache mutex. This safely recovers the lock after a panic, allowing unrelated tests to continue compiling and running their own modules instead of failing in cascade.

Rollback safety impact

n/a

@CLAassistant

CLAassistant commented Aug 30, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@bfops

bfops commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Hi @rohanranjan0902, can you re-author these commits in a way that is linked to your github user, so that the CLA check can run properly? We don't merge community PRs without a signed CLA.

@bfops

bfops commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Also, I would not say it's accurate to say that this fixes any CI flakes, since the nature of this error is that it only happens when there has already been a previous failure.

@rohanranjan0902

Copy link
Copy Markdown
Contributor Author

Hi @bfops , thanks for the review!

I've made the updates you requested:

  1. I re-authored the commit using my GitHub noreply email so that it's properly linked to my account. The CLA check is now passing!
  2. I updated the PR description, title, and commit message to clarify that this change is about gracefully recovering from lock poisoning after a panic, rather than fixing a CI flake.

Let me know if there's anything else you need before this is ready to merge!

@bfops
bfops enabled auto-merge September 21, 2026 19:23

@bfops bfops left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Seems good to me! Thank you!

@bfops

bfops commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

@rohanranjan0902 are you able to make these verified commits? If not I can have our bot re-author them.

…lockworklabs#5841)

When a previous test panics while compiling a module, the cache Mutex
becomes poisoned. This replaces .unwrap() with .unwrap_or_else() to
recover the lock, ensuring subsequent tests surface their actual
underlying errors rather than failing with a cascade of generic PoisonErrors.
auto-merge was automatically disabled September 24, 2026 17:19

Head branch was pushed to by a user without write access

@rohanranjan0902
rohanranjan0902 force-pushed the fix-ci-flake-poison-error branch from 2457747 to be130ff Compare September 24, 2026 17:19
@rohanranjan0902

Copy link
Copy Markdown
Contributor Author

@bfops I’ve recreated the PR commit as an SSH-signed commit linked to my GitHub account and force-pushed it as "be130ffb8". The signature verifies locally. I noticed GitHub automatically disabled auto-merge after the force-push. Could you please re-enable auto-merge when convenient?

@bfops

bfops commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

Great, thank you! I'll merge once the CI passes.

@bfops
bfops added this pull request to the merge queue Sep 25, 2026
Merged via the queue into clockworklabs:master with commit 163fc54 Sep 25, 2026
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants