[#1030] Keep the setup log out of the way of start-ds, and say when it is gone - #1032
Open
vharseko wants to merge 1 commit into
Open
Conversation
…t-ds, and say when it is gone Since OpenIdentityPlatform#576 the launcher scripts put java.io.tmpdir at <instance>/tmp and start-ds sweeps that directory clean before starting the server. Setup starts the server through start-ds, so its own log went with the sweep on every run; a start that failed afterwards named a file that was no longer there and printed a NoSuchFileException stack instead of the log. - start-ds / start-ds.bat: remove only the bc-fips-jni_* directories the BC FIPS native loader extracts on every start, which is what the sweep was introduced for; other files in tmp belong to tools that may still be running. - TempLogFile can be placed in a directory of the caller's choosing; SetupLauncher puts the setup log under <instance>/logs, next to server.out, falling back to the temporary directory when the launcher does not run from an installation or the directory cannot be used. - Installer checks that the log is readable before promising it, and reports a missing or unreadable log to the listeners instead of printStackTrace(). - build.yml: on a failed test step, print logs/server.out and logs/errors of the instances left behind - the server-side reason of a failed start is nowhere else. Fixes OpenIdentityPlatform#1030
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 #1030
What was wrong
Since #576 the launcher scripts put
java.io.tmpdirat<instance>/tmp, andstart-dsdidrm -rf tmp/*before starting the server. Setup starts the server throughstart-ds, so its ownopendj-setup-*.logwas unlinked mid-run on every setup; a start that failed afterwards named a file that was no longer there and printed aNoSuchFileExceptionstack instead of the log. In the non-verbose mode theserver: …lines that say why the server did not come up go only into that log, so the one place the diagnosis lived was the deleted file. Analysis and reproduction in #1030.What changes
start-ds/start-ds.bat— the sweep is narrowed to thebc-fips-jni_*directories the BC FIPS native loader extracts on every start (the name is"%s_%d"with module namebc-fips-jni, fromLoaderUtilsin bc-fips 2.1.3), which is what [#575] Set OpenDJ tmp dir to an installation directory #576 introduced it for. Other files intmp/belong to tools that may still be running. The.batblock becomes a singlefor /D … rmdirline, so the parse-time parenthesis problem the old block had to guard against does not arise.TempLogFile.newTempLogFile(prefix, directory)— the log can be placed in a directory of the caller's choosing (created if needed, fallback tojava.io.tmpdirwhennullor unusable).SetupLauncherputs the setup log under<instance>/logs, next toserver.out. Uninstall and the embedded server keep using the temporary directory.Installer.notifyListenersOfExistingLogFile— checksTempLogFile.isReadable()before promising the file; a missing log is reported withINFO_GENERAL_LOG_IN_ERROR_MISSING, a read failure withINFO_GENERAL_LOG_IN_ERROR_UNREADABLE, both to the listeners;printStackTrace()is gone.build.yml— afailure()-only step printsopendj*/logs/server.outandlogs/errorsof the instances a failed test step leaves behind; the server-side reason of a failed start is nowhere else.Verification
TempLogFileTest(new, 5 tests): the directory is created,readContents()returns the file,isReadable()follows the file rather than the logger, fallback to the temporary directory fornulland for an unusable directory. NeighbouringInstallationTest,ServerControllerTest,UtilsTestgreen (47/47).Error code: 1,See …/logs/opendj-setup-*.log, the dumped log carriesserver: … unable to bind to 0.0.0.0:31389: IOException(Address already in use), no stack trace, exit code 7 as before;tmp/: abc-fips-jni_123directory removed, an unrelatedopendj-replication-*.logkept.opendj-setup-*.logleft inlogs/,tmp/untouched.start-ds.batis exercised by the "Test on Windows" step and the MSI jobs.