forked from Netflix/conductor
-
Notifications
You must be signed in to change notification settings - Fork 4
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
[FM-751] Add system task offset evaluation strategy #179
Conversation
This file contains 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
- Added option to customize strategy used for computation of a postponed system task per task type: conductor.app.system-task-offset-evaluation.[task-type]=[strategy] [task-type] - type of the task, e.g. join, simple, ... [strategy] - strategy used for computation of the system task offset; currently supported options are: a. 'constant_default_offset' b. 'backoff_to_default_offset' c. 'scaled_by_queue_size' - 'constant_default_offset' - uses constant value of set 'systemTaskWorkerCallbackDuration' configuration property; by default, it is used by all but 'join' system tasks - 'backoff_to_default_offset' - scales offset based on task poll-count in exponential way (2^n) up to value of the 'systemTaskWorkerCallbackDuration' configuration property; by default, it is used by 'join' system task - 'scaled_by_queue_size' - scales offset based on task poll-count and actual queue size in exponential way (2^n) up to value of: a. 'backoff_to_default_offset', if queue size == 0 b. 'backoff_to_default_offset'*'queue_size' otherwise this strategy is not used in the default configuration - Implemented new 'scaled_by_queue_size' strategy is appropriate for relatively big queues (100-1000s tasks) that contain long-running tasks (days-weeks) with high number of poll-counts. Reasoning: - New strategy was implemented primarily to solve performance issues on join queues that contain a large number of join tasks blocked by wait/human actions in some forks for several days/weeks. - Implemented strategies can easily be extended in the future while preserving backwards compatibility. - Improved configurability of the task offset evaluation.
MatejGlemba
approved these changes
Nov 11, 2024
Jozefiel
approved these changes
Nov 11, 2024
- from BACKOFF_TO_DEFAULT_OFFSET - to SCALED_BY_QUEUE_SIZE
- goal: cleaner goals, separated configuration and implementation aspects - we can directly inject ConductorProperties into implementations of strategies that are represented by Spring components - introduction of TaskOffsetEvaluationSelector that allows other component to load implementation of specific strategy
- Computes the evaluation offset for a postponed task based on the task's duration and settings that define the offset for different levels of task durations. - In this strategy offset increases by steps based on settings that define the offset for different levels of task durations. Task duration is derived from {@link TaskModel#getScheduledTime()} and current time. - This strategy is appropriate for tasks that have a wide range of durations and the offset should be scaled based on the task's duration. - The defined keys in the settings compose the duration intervals for which the offset will be set to the corresponding value: <0, d1) = 0, <d1, d2) = d1, <d2, d3) = d2. - The order of the keys is not important as the map is sorted by the key before the evaluation.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
FM-751 Add system task offset evaluation strategy
Pull Request type
./gradlew generateLock saveLock
to refresh dependencies)Changes in this PR
Alternatives considered
https://nitish1503.medium.com/decoding-challenges-with-netflix-conductor-6a623b47291f - it would require too big changes in the core architecture of the conductor