Skip to content
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

Allow to override task timeout for consumer class #265

Conversation

rakovskij-stanislav
Copy link
Contributor

Hello!

While examining your karton-core code, I found karton.task_timeout config parameter (it also described in docs).

Sometimes it could hard to use united timeout for services (for example, you expect 'karton-yara' to work at most 30 sec, and 'karton-drakvuf' at most 10 mins), so it's preferable to allow custom settings for each Consumer.

This PR introduces Consumer.task_timeout that this behaviour:

  • None - use global value described in config file.
  • 0 - disable global-set task timeout.
  • positive integer - kill task on timeout.

Copy link
Member

@psrok1 psrok1 left a comment

Choose a reason for hiding this comment

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

LGTM, also fixed task timeout logging condition for consistency.

@psrok1 psrok1 changed the title Branch feature/individual timeouts Allow to override task timeout for consumer class Jan 22, 2025
@psrok1 psrok1 merged commit 504f6a7 into CERT-Polska:master Jan 22, 2025
7 checks passed
@rakovskij-stanislav
Copy link
Contributor Author

rakovskij-stanislav commented Jan 22, 2025

@psrok1
b423c82#diff-1238f1296dcb0fb9d61c95bbb69939d31701c05df46f914feccd7f5e5a38c713R331

It's better to add extra condition on timeout = 0 that says "Task timeout is disabled"

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