Skip to content

sway-lsp: remove second read from hover_data that can deadlock - #7712

Open
scaspin wants to merge 2 commits into
FuelLabs:masterfrom
scaspin:master
Open

sway-lsp: remove second read from hover_data that can deadlock#7712
scaspin wants to merge 2 commits into
FuelLabs:masterfrom
scaspin:master

Conversation

@scaspin

@scaspin scaspin commented Aug 11, 2026

Copy link
Copy Markdown

Description

Fix #7711

Checklist

  • I have linked to any relevant issues.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation where relevant (API docs, the reference, and the Sway book).
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added (or requested a maintainer to add) the necessary Breaking* or New Feature labels where relevant.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

@scaspin
scaspin requested a review from a team as a code owner August 11, 2026 18:16
@fuel-cla-bot

fuel-cla-bot Bot commented Aug 11, 2026

Copy link
Copy Markdown

Thanks for the contribution! Before we can merge this, we need @scaspin to sign the Fuel Labs Contributor License Agreement.

@cursor

cursor Bot commented Aug 11, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Single-line concurrency fix aligning with an existing code path; no behavior change beyond avoiding duplicate locking.

Overview
Fixes a potential deadlock in hover handling when a token has no separate declaration ident.

The None branch of hover_data was calling hover_format with &state.engines.read() even though the caller already holds an engines read lock and passes engines in. That redundant lock matches the Some(decl_ident) path, which already used the parameter—so hover no longer takes a second read on state.engines.

Reviewed by Cursor Bugbot for commit 2a1f164. Bugbot is set up for automated code reviews on this repo. Configure here.

@scaspin
scaspin deployed to fuel-sway-bot August 11, 2026 18:31 — with GitHub Actions Active
@scaspin
scaspin deployed to fuel-sway-bot August 11, 2026 18:44 — with GitHub Actions Active
@codspeed-hq

codspeed-hq Bot commented Aug 11, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 25 untouched benchmarks


Comparing scaspin:master (2a1f164) with master (ac418cc)

Open in CodSpeed

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.

sway-lsp: deadlock via read-lock in hover_data

1 participant