-
Notifications
You must be signed in to change notification settings - Fork 5
1026274: Worker Framework Shutdown hanging #226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
worker-core/src/main/java/com/github/workerframework/core/WorkerApplication.java
Show resolved
Hide resolved
The Documentation QA site for this branch has been built: |
More thought is required for BulkWorkerThreadPool |
worker-test/src/test/java/com/github/workerframework/workertest/ShutdownDeveloperTest.java
Show resolved
Hide resolved
worker-core/src/main/java/com/github/workerframework/core/BulkWorkerThreadPool.java
Outdated
Show resolved
Hide resolved
worker-core/src/main/java/com/github/workerframework/core/StreamingWorkerThreadPool.java
Show resolved
Hide resolved
worker-core/src/main/java/com/github/workerframework/core/WorkerApplication.java
Outdated
Show resolved
Hide resolved
worker-core/src/main/java/com/github/workerframework/core/WorkerApplication.java
Outdated
Show resolved
Hide resolved
worker-core/src/main/java/com/github/workerframework/core/WorkerThreadPool.java
Outdated
Show resolved
Hide resolved
worker-core/src/main/java/com/github/workerframework/core/WorkerApplication.java
Outdated
Show resolved
Hide resolved
worker-core/src/main/java/com/github/workerframework/core/BulkWorkerThreadPool.java
Outdated
Show resolved
Hide resolved
worker-core/src/main/java/com/github/workerframework/core/BulkWorkerThreadPool.java
Outdated
Show resolved
Hide resolved
worker-core/src/main/java/com/github/workerframework/core/WorkerApplication.java
Outdated
Show resolved
Hide resolved
worker-core/src/main/java/com/github/workerframework/core/WorkerApplication.java
Outdated
Show resolved
Hide resolved
|
||
final long startTime = System.currentTimeMillis(); | ||
|
||
while(wtp.getBacklogSize() > 0 && System.currentTimeMillis() - startTime < SHUTDOWN_DURATION) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure about this strategy of trying to clear the backlog during shutdown? Trying to complete in-progress tasks makes sense but if I'm understanding this right it is intentionally allowing new tasks to begin that haven't been passed to the worker code yet. Wouldn't we be better to clear these backlog queues and let the next worker instance pick them up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prefetched message have their delivery count increased and this goes towards the poison message identification.
I take your point that starting more messages increases the chances they get terminated after the timeout.
Let's aim to talk it through at some stage.
Deadlock was caused by the use of System.exit in the test worker, using this opportunity to simplify shutdown logic and use a non-configurable timeout.
Update the shutdownIncoming method to make the shutdown permanent so GatedHealthProvider does not trigger a reconnect.