Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion runtime/bundles/org.eclipse.core.jobs/.options
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Debugging options for the org.eclipse.core.jobs bundle

# NOTE: There is a deadlock risk when using these debug flags in a workspace
# launched from Eclipse due to interaction with a lock in the debugger console.
# launched from Eclipse due to interaction with a lock in the debugger console.
# For details: https://bugs.eclipse.org/bugs/show_bug.cgi?id=93968

# Prints debug information on running background jobs
Expand All @@ -14,4 +14,10 @@ org.eclipse.core.jobs/jobs/locks=false
org.eclipse.core.jobs/jobs/errorondeadlock=false
# Debug shutdown behaviour
org.eclipse.core.jobs/jobs/shutdown=false
# Debug jobs yielding execution so that other (blocked) jobs are given a chance to execute
org.eclipse.core.jobs/jobs/yielding=false
org.eclipse.core.jobs/jobs/yielding/detailed=false
# Debug when jobs are blocked (by other jobs) and unblocked
org.eclipse.core.jobs/jobs/blockedunblocked=false


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.700.qualifier
Bundle-Version: 3.15.800.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 @@ -245,10 +245,10 @@ private Thread[] getThreadsOwningLock(ISchedulingRule rule) {
}
}
if ((blocking.isEmpty()) && (JobManager.DEBUG_LOCKS)) {
System.out.println("Lock " + rule + " is involved in deadlock but is not owned by any thread."); //$NON-NLS-1$ //$NON-NLS-2$
JobManager.debug("Lock " + rule + " is involved in deadlock but is not owned by any thread."); //$NON-NLS-1$ //$NON-NLS-2$
}
if ((blocking.size() > 1) && (rule instanceof ILock) && (JobManager.DEBUG_LOCKS)) {
System.out.println("Lock " + rule + " is owned by more than 1 thread, but it is not a rule."); //$NON-NLS-1$ //$NON-NLS-2$
JobManager.debug("Lock " + rule + " is owned by more than 1 thread, but it is not a rule."); //$NON-NLS-1$ //$NON-NLS-2$
}
return blocking.toArray(new Thread[blocking.size()]);
}
Expand Down Expand Up @@ -354,13 +354,13 @@ void lockReleased(Thread owner, ISchedulingRule lock) {
//make sure the lock and thread exist in the graph
if (threadIndex < 0) {
if (JobManager.DEBUG_LOCKS) {
System.out.println("[lockReleased] Lock " + lock + " was already released by thread " + owner.getName()); //$NON-NLS-1$ //$NON-NLS-2$
JobManager.debug("[lockReleased] Lock " + lock + " was already released by thread " + owner.getName()); //$NON-NLS-1$ //$NON-NLS-2$
}
return;
}
if (lockIndex < 0) {
if (JobManager.DEBUG_LOCKS) {
System.out.println("[lockReleased] Thread " + owner.getName() + " already released lock " + lock); //$NON-NLS-1$ //$NON-NLS-2$
JobManager.debug("[lockReleased] Thread " + owner.getName() + " already released lock " + lock); //$NON-NLS-1$ //$NON-NLS-2$
}
return;
}
Expand All @@ -376,7 +376,8 @@ void lockReleased(Thread owner, ISchedulingRule lock) {
|| lock.isConflicting(locks.get(j)))) {
if (graph[threadIndex][j] == NO_STATE) {
if (JobManager.DEBUG_LOCKS) {
System.out.println("[lockReleased] More releases than acquires for thread " + owner.getName() + " and lock " + lock); //$NON-NLS-1$ //$NON-NLS-2$
JobManager.debug("[lockReleased] More releases than acquires for thread " + owner.getName() //$NON-NLS-1$
+ " and lock " + lock); //$NON-NLS-1$
}
} else {
graph[threadIndex][j]--;
Expand All @@ -399,13 +400,15 @@ void lockReleasedCompletely(Thread owner, ISchedulingRule rule) {
//need to make sure that the given thread and rule were not already removed from the graph
if (threadIndex < 0) {
if (JobManager.DEBUG_LOCKS) {
System.out.println("[lockReleasedCompletely] Lock " + rule + " was already released by thread " + owner.getName()); //$NON-NLS-1$ //$NON-NLS-2$
JobManager.debug(
"[lockReleasedCompletely] Lock " + rule + " was already released by thread " + owner.getName()); //$NON-NLS-1$ //$NON-NLS-2$
}
return;
}
if (ruleIndex < 0) {
if (JobManager.DEBUG_LOCKS) {
System.out.println("[lockReleasedCompletely] Thread " + owner.getName() + " already released lock " + rule); //$NON-NLS-1$ //$NON-NLS-2$
JobManager
.debug("[lockReleasedCompletely] Thread " + owner.getName() + " already released lock " + rule); //$NON-NLS-1$ //$NON-NLS-2$
}
return;
}
Expand Down Expand Up @@ -464,20 +467,20 @@ void lockWaitStop(Thread owner, ISchedulingRule lock) {
//make sure the thread and lock exist in the graph
if (threadIndex < 0) {
if (JobManager.DEBUG_LOCKS) {
System.out.println("Thread " + owner.getName() + " was already removed."); //$NON-NLS-1$ //$NON-NLS-2$
JobManager.debug("Thread " + owner.getName() + " was already removed."); //$NON-NLS-1$ //$NON-NLS-2$
}
return;
}
if (lockIndex < 0) {
if (JobManager.DEBUG_LOCKS) {
System.out.println("Lock " + lock + " was already removed."); //$NON-NLS-1$ //$NON-NLS-2$
JobManager.debug("Lock " + lock + " was already removed."); //$NON-NLS-1$ //$NON-NLS-2$
}
return;
}
if (graph[threadIndex][lockIndex] != WAITING_FOR_LOCK) {
// Lock has already been granted, nothing to do...
if (JobManager.DEBUG_LOCKS) {
System.out.println("Lock " + lock + " already granted to depth: " + graph[threadIndex][lockIndex]); //$NON-NLS-1$ //$NON-NLS-2$
JobManager.debug("Lock " + lock + " already granted to depth: " + graph[threadIndex][lockIndex]); //$NON-NLS-1$ //$NON-NLS-2$
}
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1366,14 +1366,14 @@ private long lifeTimeInMs() {
@Override
public void optionsChanged(DebugOptions options) {
DEBUG_TRACE = options.newDebugTrace(PI_JOBS);
DEBUG = options.getBooleanOption(OPTION_DEBUG_JOBS, false);
DEBUG_BEGIN_END = options.getBooleanOption(OPTION_DEBUG_BEGIN_END, false);
DEBUG_YIELDING = options.getBooleanOption(OPTION_DEBUG_YIELDING, false);
DEBUG_YIELDING_DETAILED = options.getBooleanOption(OPTION_DEBUG_YIELDING_DETAILED, false);
DEBUG_DEADLOCK = options.getBooleanOption(OPTION_DEADLOCK_ERROR, false);
DEBUG_LOCKS = options.getBooleanOption(OPTION_LOCKS, false);
DEBUG_SHUTDOWN = options.getBooleanOption(OPTION_SHUTDOWN, false);
DEBUG_BLOCKED_UNBLOCKED = options.getBooleanOption(OPTION_DEBUG_BLOCKED_UNBLOCKED, false);
DEBUG = options.getBooleanOption(OPTION_DEBUG_JOBS, DEBUG);
DEBUG_BEGIN_END = options.getBooleanOption(OPTION_DEBUG_BEGIN_END, DEBUG_BEGIN_END);
DEBUG_YIELDING = options.getBooleanOption(OPTION_DEBUG_YIELDING, DEBUG_YIELDING);
DEBUG_YIELDING_DETAILED = options.getBooleanOption(OPTION_DEBUG_YIELDING_DETAILED, DEBUG_YIELDING_DETAILED);
DEBUG_DEADLOCK = options.getBooleanOption(OPTION_DEADLOCK_ERROR, DEBUG_DEADLOCK);
DEBUG_LOCKS = options.getBooleanOption(OPTION_LOCKS, DEBUG_LOCKS);
DEBUG_SHUTDOWN = options.getBooleanOption(OPTION_SHUTDOWN, DEBUG_SHUTDOWN);
DEBUG_BLOCKED_UNBLOCKED = options.getBooleanOption(OPTION_DEBUG_BLOCKED_UNBLOCKED, DEBUG_BLOCKED_UNBLOCKED);
}

@Override
Expand All @@ -1395,7 +1395,7 @@ final void reportBlocked(IProgressMonitor monitor, Collection<InternalJob> block
IStatus reason;
InternalJob blockingJob = blockingJobs.stream().sorted(Comparator.comparing(InternalJob::isSystem)).findFirst()
.orElse(null);
if (blockingJob == null || blockingJob instanceof ThreadJob || blockingJob.isSystem()) {
if (blockingJob == null || blockingJob instanceof ThreadJob) {
reason = new Status(IStatus.INFO, JobManager.PI_JOBS, 1, JobMessages.jobs_blocked0, null);
} else {
String msg = NLS.bind(JobMessages.jobs_blocked1, blockingJob.getName());
Expand Down
Loading