Repository navigation
Move job queues to lib-data-workqueue, fix duplicate job processing and drain on shutdown #1201
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
Merged
Merged
Changes from 16 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
2bb3f3b
Replace lib-data-stream-redis with lib-data-workqueue
pditommaso 2ab1fe8
Merge remote-tracking branch 'origin' into replace-message-stream-wit…
munishchouhan b5fc2b5
Fall back work-queue config to legacy message-stream settings
pditommaso 312c69c
Fix work-queue config placeholders to use Micronaut multi-key syntax
munishchouhan 99c8684
Merge branch 'master' into replace-message-stream-with-workqueue
munishchouhan 5496e31
Merge branch 'master' into replace-message-stream-with-workqueue
pditommaso cd07b7f
Merge branch 'master' into replace-message-stream-with-workqueue
pditommaso d6020a2
Merge branch 'master' into replace-message-stream-with-workqueue
pditommaso 2ed545a
Merge remote-tracking branch 'origin/master' into replace-message-str…
pditommaso c2be3d6
test: lower work-queue visibility timeout in test config
pditommaso 07e74f1
Merge branch 'master' into replace-message-stream-with-workqueue
pditommaso c5af153
Run job status checks on the DEFERRED work-queue model
pditommaso 30d9c3a
Set a read timeout on the k8s API client
pditommaso 4c231f2
Drain the job queues on graceful shutdown
pditommaso af9394d
Merge remote-tracking branch 'origin/master' into job-processing-defe…
pditommaso 4ad98ac
Keep job queue consumers synchronous, binding the lease liveness
pditommaso fee073f
Default the work-queue visibility timeout to 20s
pditommaso File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 0 additions & 72 deletions
72
src/main/groovy/io/seqera/wave/service/data/stream/RedisStreamConfigBean.groovy
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
src/main/groovy/io/seqera/wave/service/data/workqueue/RedisWorkQueueConfigBean.groovy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| /* | ||
| * Wave, containers provisioning service | ||
| * Copyright (c) 2023-2025, Seqera Labs | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU Affero General Public License as published by | ||
| * the Free Software Foundation, either version 3 of the License, or | ||
| * (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU Affero General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU Affero General Public License | ||
| * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
| */ | ||
|
|
||
| package io.seqera.wave.service.data.workqueue | ||
|
|
||
| import java.time.Duration | ||
|
|
||
| import groovy.transform.CompileStatic | ||
| import io.micronaut.context.annotation.Value | ||
| import io.seqera.data.workqueue.redis.RedisWorkQueueConfig | ||
| import jakarta.inject.Singleton | ||
|
|
||
| /** | ||
| * Configuration bean for the Redis backed work queue in Wave application. | ||
| * | ||
| * <p>This configuration provides centralized settings for Redis work queue | ||
| * components, including consumer group management and lease timings. The | ||
| * configuration values are injected from application properties with sensible | ||
| * defaults. | ||
| * | ||
| * <p>Configuration properties (each falls back to the legacy {@code wave.message-stream.*} | ||
| * property it replaces, then to the default shown): | ||
| * <ul> | ||
| * <li>{@code wave.work-queue.consumer-group-name} - Name for the Redis consumer group | ||
| * (falls back to {@code wave.message-stream.consumer-group-name}; default: "wave-message-stream")</li> | ||
| * <li>{@code wave.work-queue.visibility-timeout} - How long a claimed message stays invisible to other | ||
| * consumers before being redelivered (falls back to {@code wave.message-stream.claim-timeout}; default: 45s)</li> | ||
| * <li>{@code wave.work-queue.consumer-warn-timeout} - Timeout threshold for consumer warnings | ||
| * (falls back to {@code wave.message-stream.consume-warn-timeout}; default: 45s)</li> | ||
| * </ul> | ||
| * | ||
| * <p>The fallback to the legacy {@code message-stream} keys means a deployment configured for the | ||
| * message-stream implementation keeps its values after the work-queue upgrade with no config change; | ||
| * the final defaults (45s) match the current production deployment. | ||
| * | ||
| * <p>Note the consumer group name default is intentionally {@code wave-message-stream}: | ||
| * the work queue reuses the Redis streams and consumer group created by the message | ||
| * stream implementation it replaces, so messages queued before an upgrade are still | ||
| * delivered afterwards. | ||
| * | ||
| * <p>Example application configuration: | ||
| * <pre> | ||
| * # application.yml | ||
| * wave: | ||
| * work-queue: | ||
| * consumer-group-name: "wave-prod-queue" | ||
| * visibility-timeout: "10s" | ||
| * consumer-warn-timeout: "8s" | ||
| * </pre> | ||
| * | ||
| * <p>This bean implements {@link RedisWorkQueueConfig} to provide configuration | ||
| * values to Redis work queue components throughout the application. | ||
| * | ||
| * @author Paolo Di Tommaso <paolo.ditommaso@gmail.com> | ||
| * @see io.seqera.data.workqueue.redis.RedisWorkQueueConfig | ||
| */ | ||
| @CompileStatic | ||
| @Singleton | ||
| class RedisWorkQueueConfigBean implements RedisWorkQueueConfig { | ||
|
|
||
| // Each setting falls back to the legacy `wave.message-stream.*` property it replaces, so | ||
| // a deployment configured for the message-stream implementation keeps its values after the | ||
| // work-queue upgrade without any config change. The final defaults match the current | ||
| // production deployment (see platform-deployment). | ||
| @Value('${wave.work-queue.consumer-group-name:wave.message-stream.consumer-group-name:wave-message-stream}') | ||
| String defaultConsumerGroupName | ||
|
|
||
| @Value('${wave.work-queue.visibility-timeout:wave.message-stream.claim-timeout:45s}') | ||
| Duration visibilityTimeout | ||
|
|
||
| @Value('${wave.work-queue.consumer-warn-timeout:wave.message-stream.consume-warn-timeout:45s}') | ||
| Duration consumerWarnTimeout | ||
|
|
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.