Uh oh!
There was an error while loading. Please reload this page.
[#696] Fix embedded server setup failing with "Time service not started" - #687
Merged
vharseko merged 2 commits intoJul 8, 2026
Merged
Conversation
EmbeddedDirectoryServer.rebuildIndex() is an offline-only operation (it requires the server to be stopped), but RebuildIndexParameters did not pass the --offline flag to the rebuild-index tool. Since TaskTool runs locally only when --offline is given, the tool went into task scheduling mode instead: it prompted for the bind password and tried to connect to the tasks backend of the stopped server, failing with 'Connect Error' and exit code 1. Move EmbeddedDirectoryServerTestCase out of the "slow" group into the default build (11 tests, ~1 minute). testSetupFromArchive stays in the "slow" group for now: it fails with "Time service not started" because the slf4j adapter still routes through the stopped main server's error log publishers; it will be enabled together with the fix for that.
EmbeddedDirectoryServer.setup() failed with an IllegalStateException before even launching the installer: TempLogFile registers a TextErrorLogPublisher to capture setup messages and immediately logs through it, and the publisher formats its timestamp with TimeThread.getLocalTime(), which throws when the time service is not running. That is the normal state in a fresh JVM (the main embedded use case) or after an in-JVM server has been stopped. Make TimeThread.getLocalTime() compute the timestamp on demand when the time service is not running instead of throwing; it is the only TimeThread accessor used by the text log publishers, and the other accessors keep their strict lifecycle check. Enable EmbeddedDirectoryServerTestCase.testSetupFromArchive in the default build now that it passes.
maximthomas
approved these changes
Jul 6, 2026
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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#696
Problem
EmbeddedDirectoryServer.setup()fails with:TempLogFileregisters aTextErrorLogPublisherto capture setup messages into the temporary log file and immediately logs through it. The publisher formats its timestamp withTimeThread.getLocalTime(), which throws when the time service is not running — and that is the normal state atsetup()time: in a fresh JVM (the main embedded use case) nothing has started the time service yet, and in a JVM where an in-process server was stopped the service has been shut down. The failure happens before the installer (InstallDS) is even launched.Found by running the
slowTestNG group (excluded from CI), whereEmbeddedDirectoryServerTestCase.testSetupFromArchivefails.Fix
Make
TimeThread.getLocalTime()compute the timestamp on demand (samedd/MMM/yyyy:HH:mm:ss Zformat) when the time service is not running, instead of throwing. It is the onlyTimeThreadaccessor used by the text log publishers (TextErrorLogPublisher,TextDebugLogPublisher); all other accessors keep their strict lifecycle check.Enable
EmbeddedDirectoryServerTestCase.testSetupFromArchivein the default build now that it passes.Verification
EmbeddedDirectoryServerTestCase: 12/12 pass under the default CI group filter (~93s), includingtestSetupFromArchivefor the first time.Note: this branch is stacked on #685 (both change
EmbeddedDirectoryServerTestCase); once #685 is merged only the single commit of this PR remains.