Skip to content

Commit

Permalink
Improve "Job found still running" message
Browse files Browse the repository at this point in the history
* add state and stacktrace of running job
* only log the message once
  • Loading branch information
EcljpseB0T committed Jun 18, 2024
1 parent 8969f83 commit 9dd20ae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion runtime/bundles/org.eclipse.core.jobs/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.core.jobs; singleton:=true
Bundle-Version: 3.15.300.qualifier
Bundle-Version: 3.15.400.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: org.eclipse.core.internal.jobs;x-internal:=true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -720,16 +720,17 @@ private void doShutdown() {
}
internalWorker.cancel();
if (toCancel != null) {
for (Job element : toCancel) {
String jobName = printJobName(element);
for (Job job : toCancel) {
String jobName = printJobName(job) + " " + printState(job); //$NON-NLS-1$
if (job.getThread() instanceof Thread t) {
StackTraceElement[] stackTrace = t.getStackTrace();
for (StackTraceElement stackTraceElement : stackTrace) {
jobName += "\n\t at " + stackTraceElement; //$NON-NLS-1$
}
}
//this doesn't need to be translated because it's just being logged
String msg = "Job found still running after platform shutdown. Jobs should be canceled by the plugin that scheduled them during shutdown: " + jobName; //$NON-NLS-1$
RuntimeLog.log(new Status(IStatus.WARNING, JobManager.PI_JOBS, JobManager.PLUGIN_ERROR, msg, null));

// TODO the RuntimeLog.log in its current implementation won't produce a log
// during this stage of shutdown. For now add a standard error output.
// One the logging story is improved, the System.err output below can be removed:
System.err.println(msg);
}
}
synchronized (lock) {
Expand Down

0 comments on commit 9dd20ae

Please sign in to comment.