Skip to content

fix(bigshot.lic): v5.16.0 looting races eloot on resume when both are paused - #2433

Merged
mrhoribu merged 4 commits into
docs/bigshot-yard-documentationfrom
fix/bigshot-looting-watch-pause-race
Sep 11, 2026
Merged

mrhoribu merged 4 commits into
docs/bigshot-yard-documentationfrom
fix/bigshot-looting-watch-pause-race

Conversation

@mrhoribu

Copy link
Copy Markdown
Contributor

Summary

Test plan

  • New regression spec spec/bigshot/looting_watch_spec.rb, following the source-extraction-and-eval technique from spec/bigshot/priority_spec.rb. Uses a Mutex/ConditionVariable + Queue-based stub instead of sleep-based polling, so the race is deterministic:
    • blocks while bigshot is paused even though the loot script is also paused, and only returns once bigshot is unpaused
    • still breaks immediately on the loot script's own pause once bigshot itself was never paused (no behavior change for the common case)
    • kill/box-in-hand/rest-flag handling after the loop unaffected
  • Audited every other Script.paused?/Script.running? call site in bigshot.lic for the same bug shape - none found; this was the only raw polling loop watching another script's state without also checking its own
  • bin/migrate run first (gameobj-data fixtures)
  • bundle exec rspec - full suite passing
  • RBENV_VERSION=4.0.5 rubocop -A - clean

Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 4a7c7234-382d-4d27-859b-21569be50119

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

mrhoribu and others added 4 commits September 10, 2026 20:26
…state

looting_watch only checked the watched script's (eloot's) pause state,
never bigshot's own. When something paused bigshot and eloot back to
back (e.g. ecleanse pausing a script list for a disarm-recovery cast),
looting_watch noticed eloot's pause and returned to its caller
immediately, regardless of whether bigshot itself had also just been
paused. That let bigshot's thread advance to the next corpse's
run_script/Script.kill one iteration early, racing eloot's own
independently-resumed thread with no reliable ordering.

Add Script.current at the top of the loop - the same idiom lich-5 uses
elsewhere (echo, fput, ...) to block on the calling script's own pause
via Script#wait_while_paused! - so bigshot's own pause is checked on
every iteration, not just at entry.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Keep this fix landing as part of the v5.16.0 release the rest of the
stacked PRs are shipping, rather than a separate v5.16.1. Also rewrites
the v5.16.0 changelog entries (including this one) in plain,
player-facing language instead of implementation detail.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Due to performance and fixes in Lich 5.21.0 for Creature and Combat API
@mrhoribu
mrhoribu force-pushed the fix/bigshot-looting-watch-pause-race branch from afd3e48 to 5c51b3b Compare September 11, 2026 00:27
@mrhoribu
mrhoribu merged commit 6bb948c into master Sep 11, 2026
4 checks passed
@mrhoribu
mrhoribu deleted the fix/bigshot-looting-watch-pause-race branch September 11, 2026 00:34
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.

1 participant