Title: Can long-running tasks that haven't been completed be requeued after a graceful shutdown times out? · taskiq-python · Discussion #447 · GitHub
Open Graph Title: Can long-running tasks that haven't been completed be requeued after a graceful shutdown times out? · taskiq-python · Discussion #447
X Title: Can long-running tasks that haven't been completed be requeued after a graceful shutdown times out? · taskiq-python · Discussion #447
Description: Can long-running tasks that haven't been completed be requeued after a graceful shutdown times out?
Open Graph Description: I have a test task that takes more than 30 seconds to execute as follows: @broker.task() async def test(v: int): print(f"start {v}") await asyncio.sleep(35) print(f"end {v}") I started TaskIQ with ...
X Description: I have a test task that takes more than 30 seconds to execute as follows: @broker.task() async def test(v: int): print(f"start {v}") await asyncio.sleep(35) print(f"end {v}") I ...
Opengraph URL: https://github.com/orgs/taskiq-python/discussions/447
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"Can long-running tasks that haven't been completed be requeued after a graceful shutdown times out?","text":"I have a test task that takes more than 30 seconds to execute as follows:
\n@broker.task()\nasync def test(v: int):\n print(f\"start {v}\")\n await asyncio.sleep(35)\n print(f\"end {v}\")\n
\nI started TaskIQ with the following command: taskiq worker tasks.taskiq_init:broker -fsd --pattern=\"tasks/taskiq/tasks/*.py\" --shutdown-timeout=5 --wait-tasks-timeout=25.
\nWhen the test task began executing, I quickly used Ctrl+C and wait taskiq shutdown(the test task wasn't finished during the shutdown). Then I ran TaskIQ again. The test task did not re-execute. This behavior is different from sidekiq and Celery, which both requeue tasks that were not completed during shutdown.
\nIs there an issue with the way I'm using TaskIQ(I use redis-broker)? Or does TaskIQ not have this feature? Is there any way to implement this functionality myself? This is a crucial feature for us because our project involves a large number of long-running tasks, each of which may take several minutes to execute.
\nsincerely thanks!
","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"I found a problem with redis streams. Suddenly whem you fetch new messages from the stream, redis doesn't send unacknowledged messages along with new ones. Clients should fetch and claim them themselves.
\nI've updated the way we handle unacknowledged messages and released new version of taskiq-redis. https://github.com/taskiq-python/taskiq-redis/releases/tag/1.0.6 Please try it out.
","upvoteCount":0,"url":"https://github.com/orgs/taskiq-python/discussions/447#discussioncomment-12874089"}}}
| route-pattern | /_view_fragments/Voltron::DiscussionsFragmentsController/show/orgs/:org/:discussion_number/discussion_layout(.:format) |
| route-controller | voltron_discussions_fragments |
| route-action | discussion_layout |
| fetch-nonce | v2:9007b75e-4e2a-79ec-e274-2621e8e1683e |
| current-catalog-service-hash | 9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be |
| request-id | 9F10:2946F1:1D23F26:25D8856:696D779D |
| html-safe-nonce | db05ae2e11f7e67cdecdc837a6a19b39e1851ea6daabb56fdbdb5cb41e482180 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RjEwOjI5NDZGMToxRDIzRjI2OjI1RDg4NTY6Njk2RDc3OUQiLCJ2aXNpdG9yX2lkIjoiMzI5MzczMTE0NDU2NDgzMjE1NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | df9ec26836cd4a6eed753294f96af4c3ace97bd9133d15e93e8fa55d9068c489 |
| hovercard-subject-tag | discussion:8212037 |
| github-keyboard-shortcuts | repository,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/Voltron::DiscussionsFragmentsController/show/orgs/taskiq-python/447/discussion_layout |
| twitter:image | https://opengraph.githubassets.com/a44175d013b94611615b82fc1064ff9596522f0c9a0333125ce77727cc16f857/orgs/taskiq-python/discussions/447 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a44175d013b94611615b82fc1064ff9596522f0c9a0333125ce77727cc16f857/orgs/taskiq-python/discussions/447 |
| og:image:alt | I have a test task that takes more than 30 seconds to execute as follows: @broker.task() async def test(v: int): print(f"start {v}") await asyncio.sleep(35) print(f"end {v}") I started TaskIQ with ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4922b452d03cd8dbce479d866a11bc25b59ef6ee2da23aa9b0ddefa6bd4d0064 |
| turbo-cache-control | no-preview |
| octolytics-dimension-user_id | 109470701 |
| octolytics-dimension-user_login | taskiq-python |
| octolytics-dimension-repository_id | 514860374 |
| octolytics-dimension-repository_nwo | taskiq-python/taskiq |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 514860374 |
| octolytics-dimension-repository_network_root_nwo | taskiq-python/taskiq |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7e5ae23c70136152637ceee8d6faceb35596ec46 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width