Repository navigation
Conversation
Scripts interrupted on stop while waiting on the client thread or the EDT surfaced InterruptedException as ERROR logs and script error telemetry. Log interruption-caused failures at debug in Microbot.log, restore the interrupt flag in showMessage, and skip interrupted root causes in ScriptErrorReporter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review. WalkthroughThe showMessage overloads now restore interrupt status and log interrupted waits at DEBUG. Microbot.log checks exception cause chains and logs interruptions at DEBUG while retaining ERROR logging for other exceptions. ScriptErrorReporter skips errors whose resolved root cause is an InterruptedException. Tests cover logging levels and exclusion from pending reports. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to Script shutdown interruptions are now treated as cancellation instead of errors. The change is small and tested, and no merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
Problem
Script error telemetry (client 2.6.30) cluster E15: 18 groups / 76 reports / ~1894 occurrences of
java.lang.InterruptedException(groups 121, 43, 206, 26, 207, 156, 67, 200, 205, 242, 323, 148, 170, 177, 315, ...).CompletableFuture.getinClientThread.invoke(Supplier)(callersRs2ActorModel.getWorldLocation,Rs2Tile.runClientRead,AbstractEntityQueryable.nearestOnClientThread,Rs2GameObject.getSceneObjectsviaRs2Bank, ...), logged by script catch blocks viaMicrobot.logStackTrace(messagesAttackNpcScript,Rs2Bank, ...) or by third-party/StateMachine loggers.SwingUtilities.invokeAndWaitinMicrobot.showMessage("Error displaying message {}:", VarrockAnvil / JewelleryEnchant).Root cause
A script thread is interrupted when the script stops (
scheduledFuture.cancel(true)) while blocked waiting on the client thread or the EDT.ClientThread.invokealready restores the interrupt flag and rethrowsRuntimeException("Interrupted waiting for client thread", ie); script loops then catch it and log it as ERROR, andScriptErrorReporterreports theInterruptedExceptionroot cause.showMessagecaught the interrupt as a generic exception, logged ERROR and lost the interrupt flag.Change
Microbot.log(..., ERROR, ex): if the cause chain containsInterruptedException, log at DEBUG instead of ERROR.Microbot.showMessage(both overloads): catchInterruptedException, restore the interrupt flag, log at DEBUG.ScriptErrorReporter.append: skip events whose root cause isInterruptedException(covers non-Microbotloggers too).ClientThread.invokeis untouched (flag already restored; avoids overlap with fix(client-thread): log client-thread timeouts as rate-limited warning #1912). Interrupt flags are never cleared, so scripts' running/sleep checks still stop the loop.Validation
./gradlew :client:runUnitTests --tests '*MicrobotLogInterruptTest' --tests '*ScriptErrorReporterTest'-> 13 tests, 0 failures (includes:client:compileJava).MicrobotLogInterruptTest: interrupted client-thread wait logs DEBUG; other failures still ERROR.ScriptErrorReporterTest.ignoresInterruptedWaits.Known gaps
Microbot.log) still emit an ERROR line locally; only telemetry is suppressed for them.showMessagepath (would pop a Swing dialog).ScriptErrorReporter/its test, also touched by fix(microbot): error telemetry follow-ups from release review #1902 (different hunks).🤖 Generated with Claude Code