Repository navigation
Conversation
The config watch loop never drained or reset the key returned by take(), so once an event produced no config change the key was never re-queued and later edits were ignored until restart. Drain events and reset the key after each take(), re-registering the config path if the key is no longer valid. Fixes #2624 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HttpWatchKey.reset() threw UnsupportedOperationException, and cancel() threw NullPointerException when the key had not yet issued its first watch request. Keys now follow the WatchKey contract: a signalled key is queued once and re-queued by reset() only when events are pending. cancel() works at any point and stops further watch requests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Register the config directory synchronously before writing, then wait on observed watch callbacks instead of polling with sleeps. Enable config watch explicitly and use generous timeouts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
akrambek
marked this pull request as ready for review
October 2, 2026 14:54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2624
Problem
EngineConfigWatchTask.call()loops onwatcher.take()and callsonPathChanged(...), but never callspollEvents()orreset()on the returned key. A signalledWatchKeyis not re-queued until it is reset. When an event leaves the config text unchanged,EngineManager.onPathChangedreturns early, nothing re-arms the key, and every later config change is ignored until restart.HttpWatchKey(filesystem-http) does not implementreset(): it throwsUnsupportedOperationException. So once the watch loop resets keys, http-sourced configs stop reloading after the first change.HttpWatchKey.cancel()throwsNullPointerExceptionif the key has not sent its first watch request yet. A reload that unregisters such a key fails, so the new config is rejected.Change
take(), drainkey.pollEvents(), callonPathChanged(...), then callkey.reset(). This happens whether or not the config changed. Ifreset()reports the config path key is no longer valid, register the config path again.HttpWatchKeynow follows theWatchKeycontract.reset()re-queues it only if events are still pending, and returnsfalseonce the key is cancelled.cancel()works before the first watch request, and a cancelled key sends no further watch requests.Consumers of
HttpWatchServicemust now callreset()after handling a key, as theWatchKeycontract requires. Before this change, a key was queued again on every event.Tests
EngineConfigWatchTaskTest.shouldApplyChangeAfterUnchangedRewrite: rewrite the local config with the same text, then change it; the change is applied.EngineConfigWatchTaskTest.shouldApplyHttpChangesAfterReload: an http-sourced config (local long-poll server with etags) changes twice, and both changes are applied.HttpFileSystemTest.shouldCancelWatchKeyBeforeWatching: cancelling right afterregisterdoes not throw; the key is invalid andreset()returnsfalse.HttpFileSystemIT.shouldWatch: now callsreset()between the twotake()calls and checks that it returnstrue.Each new test failed before its fix and passes after it.
馃 Generated with Claude Code