Skip to content

RefreshableResponseProvider.shutdown without waiting for queued tasks#163

Merged
sthuebner merged 1 commit intoheremaps:masterfrom
sthuebner:shutdownNow
Apr 27, 2026
Merged

RefreshableResponseProvider.shutdown without waiting for queued tasks#163
sthuebner merged 1 commit intoheremaps:masterfrom
sthuebner:shutdownNow

Conversation

@sthuebner
Copy link
Copy Markdown
Contributor

In many of our unit tests we involve instances of
RefreshableResponseProvider.

Problem is, we run into the issue of a large number of pending threads not being shutdown after test execution. This leads to OutOfMemoryExceptions during test runs, especially on MacOS systems.

The root cause is the RefreshableResponseProvider's executor service "here-auth-refresher" thread is never being shutdown really, because there is always a refresh task waiting in the queue, usually.

This commit forces the RefreshableResponseProvider's executor service to shutdown without waiting for the task queue to deplete. In local tests, this change nicely cleans up all refresher threads.

In many of our unit tests we involve instances of
`RefreshableResponseProvider`.

Problem is, we run into the issue of a large number of pending threads
not being shutdown after test execution. This leads to
OutOfMemoryExceptions during test runs, especially on MacOS systems.

The root cause is the `RefreshableResponseProvider`'s executor service
"here-auth-refresher" thread is never being shutdown really, because
there is always a refresh task waiting in the queue, usually.

This commit forces the `RefreshableResponseProvider`'s executor
service to shutdown without waiting for the task queue to deplete. In
local tests, this change nicely cleans up all refresher threads.

Signed-off-by: Stefan Hübner <stefan.hubner@here.com>
@sthuebner sthuebner self-assigned this Apr 9, 2026
@sthuebner sthuebner merged commit ba61656 into heremaps:master Apr 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants