Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Job framework become unusable after stopping and restarting the "org.eclipse.core.jobs" bundle

未关闭
#2,783 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
75/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
冷清
技术栈
java
领域
tooling

调研方向

复现 org.eclipse.core.jobs bundle 的停止和重启序列,然后从 org.eclipse.core.internal.jobs.InternalJob 和 JobManager 入手,尤其关注堆栈跟踪中显示的调度路径。检查调度新的 Job 时,重启后的 bundle 是如何表示的。完成标准是:bundle 重启后可以创建并调度 Job,并且针对所报告序列具有回归测试覆盖。

由索引模型根据 Issue 内容生成。

描述

bug

Let's make sure issue is not already fixed in latest builds first.

Not checked with the latest Build, but checked that the affected bundle has been unchanged compared to the version I tried with.

Steps to reproduce

  • In a running application, stop the "org.eclipse.core.jobs" bundle
  • restart the bundle
  • create a new job

This fails with an exception

I expected: That the bundle can be stopped and restarted

But got: it becomes unusable after restarting

Looking at the failing code, it looks like the class "InternalJob" keeps a cached instance of the first ever created JobManager in a static final field and only uses that for all created instances of InternalJob instead of using the current running JobManager.

Here is some relevant log output

From <workspace>/.metadata/.log

Command-line arguments:  -application eclipse-core-jobs-sample.id1 -data W:\fis\ws\fa_99.99.0/../runtime-eclipse-core-jobs-sample.id1 -dev file:///W:/fis/ws/fa_99.99.0/.metadata/.plugins/org.eclipse.pde.core/eclipse-core-jobs-sample.id1/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog

!ENTRY org.eclipse.osgi 4 0 2026-06-28 11:40:00.218
!MESSAGE Application error
!STACK 1
java.lang.IllegalStateException: Job manager has been shut down.
	at org.eclipse.core.internal.jobs.JobManager.scheduleInternal(JobManager.java:1485)
	at org.eclipse.core.internal.jobs.JobManager.lambda$5(JobManager.java:1475)
	at org.eclipse.core.internal.jobs.JobManager.withWriteLock(JobManager.java:568)
	at org.eclipse.core.internal.jobs.JobManager.schedule(JobManager.java:1474)
	at org.eclipse.core.internal.jobs.InternalJob.schedule(InternalJob.java:402)
	at org.eclipse.core.runtime.jobs.Job.schedule(Job.java:654)
	at sample.Application.start(Application.java:35)

Code for reproduction

		BundleContext bundleContext = FrameworkUtil.getBundle(getClass()).getBundleContext();
		
		Bundle coreJobs = Arrays.stream(	bundleContext.getBundles()).filter(x -> x.getSymbolicName().equals("org.eclipse.core.jobs")).findFirst().orElseThrow();
		
		coreJobs.stop();
		
		coreJobs.start();
		
		Job job = new Job("test") {

			@Override
			protected IStatus run(IProgressMonitor monitor) {
				return Status.OK_STATUS;
			}
		};
		job.schedule();

Tested under this environment:

  • OS & version: Windows, 11
  • Eclipse IDE/Platform version (as shown in Help > About): Eclipse 25-12

Community

  • I understand reporting an issue to this OSS project does not mandate anyone to fix it. Other contributors may consider the issue, or not, at their own convenience. The most efficient way to get it fixed is that I fix it myself and contribute it back as a good quality patch to the project.
主要语言
Java
星标
165
派生
174
平均合并
2 天 16 小时
30 天内合并 PR
45

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

eclipse-platform/eclipse.platform 的其他 Issue

查看 eclipse-platform/eclipse.platform 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。