Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Payara 3141: Update message related to Request Tracing store not active. #3214

Merged
merged 3 commits into from Oct 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -987,6 +987,7 @@ public PayaraMicroRuntime bootStrap() throws BootstrapException {
throw new BootstrapException("Problem unpacking the Runtime", ex);
}
resetLogging();
runtimeDir.processDirectoryInformation();

// build the runtime
BootstrapProperties bprops = new BootstrapProperties();
Expand Down
Expand Up @@ -64,6 +64,8 @@
*/
class RuntimeDirectory {

private static final Logger LOGGER = Logger.getLogger("PayaraMicro");

private final File directory;
private boolean isTempDir = true;

Expand All @@ -80,6 +82,9 @@ class RuntimeDirectory {
*/
RuntimeDirectory() throws IOException, URISyntaxException {
// check if we have exploded our runtime
// TODO This logic is not entirely correct in regard the isTempDir.
// fish.payara.micro.tmpdir is also set by ExplodedURLClassloader, possibly based on the --rootdir.
// And then it is not a temporary directory.
String runTimeDir = System.getProperty("fish.payara.micro.tmpdir");
if (runTimeDir == null) {
String tmpDir = System.getProperty("glassfish.embedded.tmpdir");
Expand Down Expand Up @@ -114,6 +119,13 @@ public File getDirectory() {
return directory;
}

public void processDirectoryInformation() {
if (isTempDir) {
LOGGER.warning("Payara Micro Runtime directory is located in a temporary file location which can be cleaned by system processes.");
}
LOGGER.info(String.format("Payara Micro Runtime directory is located at %s", directory.getAbsolutePath()));
}

private void unpackRuntime() throws URISyntaxException, IOException {

// make a docroot here
Expand Down
Expand Up @@ -101,7 +101,7 @@ public void execute(AdminCommandContext context) {

RequestTracingExecutionOptions executionOptions = service.getExecutionOptions();
if ((historicTraces == null || historicTraces) && !executionOptions.isHistoricTraceStoreEnabled()) {
actionReport.setMessage("Request Trace Store is not enabled!");
actionReport.setMessage("Historic Request Trace Store is not enabled!");
actionReport.setActionExitCode(ActionReport.ExitCode.SUCCESS);
}
else {
Expand Down