Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ public Thread newThread(Runnable r) {
}

executor = new ScheduledThreadPoolExecutor(coreSize, threadFactory);
executor.setRemoveOnCancelPolicy(true);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve Java 6 timer compatibility

This call uses ScheduledThreadPoolExecutor.setRemoveOnCancelPolicy, which is only available starting in Java 7, but the project still documents support for “Java 6 or later” in README.md:140. On a Java 6 runtime, initializing HystrixTimer now throws NoSuchMethodError here before initialized is set, leaving the singleton executor non-null but uninitialized; later timer use can then spin in startThreadIfNeeded() instead of recovering. Please either avoid this API on Java 6 (for example by reflective/version-gated use) or explicitly drop Java 6 support.

Useful? React with 👍 / 👎.

initialized = true;
}

Expand Down