Import tasks getting stuck mid execution
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- aws, go, rabbitmq
- Domain
- backend, distributed-systems
Research direction
Start with the 10-minute timeout in task/runner.go, then trace the import task's progress reporting, piping, and S3 upload paths. Reproduce or instrument the reported stuck-task cases, including the large and regular asset examples. Done means the cause is identified and import tasks no longer remain silent and are not repeatedly re-executed after RabbitMQ redelivery.
Written by the indexing model from the issue text.
Description
We have some weird cases of tasks getting stuck mid execution. These tasks just keep getting
re-executed, since the RabbitMQ will eventually timeout (after 30m) waiting on an ACK and just
terminates the connection with the client (nacking all messages it had in-flight). The task is then
re-executed as if nothing happened [1].
[1] This is also another bug that we should address. Should just fail if the task had already tried
running before and just disappeared, which we can already tell from the metadata in the API. This
is not the root cause though so we still need to investigate and fix the stuck tasks.
No logs that indicate what is wrong, but I have a light suspicion on either:
- the "progress reporting" logic
- the "piping" logic in the import task which sends a stream both to
ffprobeand to the storage - the S3 upload client
On the first tasks I found this error, they were actually importing large stream recordings which take
12+ minutes to download on a good connection, due to the on-demand MP4 generation bottleneck.
It was already weird since we have a hard timeout of 10 minutes so the task runner
should have just failed the task, instead of gone silent.
Right now I just found an even weirder case though. It was from a regular "import" task, which is not
importing a recording but actually just another asset as a test that the user was making. This is the
task:
{
"id": "51ea2a1e-618e-452d-a024-7c5a0ace266f",
"type": "import",
"params": {
"import": {
"url": "https://livepeercdn.com/asset/REDACTED/video"
}
},
"status": {
"phase": "running",
"progress": 0.649,
"updatedAt": 1651269956139
},
"userId": "REDACTED",
"createdAt": 1650886712179,
"outputAssetId": "4582de3b-ead3-4ffe-8b6d-b130f61290a1"
}
The asset has around 5GB and takes less than a minute to download from a good connection, so there's
no clear reason of why the task-runner is getting stuck.
- Dominant language
- Go
- Stars
- 3
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from livepeer/task-runner
-
Out of bounds panics when processing catalyst callback messagesMay be free again @gioelecerati claimed this 1337 days ago, and no pull request is open. Open
livepeer/task-runner#136 · 1 assignee ·
-
"error processing ffprobe output: no video track found in file" for audio only inputMay be free again @red-0ne claimed this 1366 days ago, and no pull request is open. Open
livepeer/task-runner#121 · 1 assignee ·
-
catalyst task lost (last update 1m58.390845005s ago) after retrying for an Acceleration faultMay be free again @thomshutt claimed this 1386 days ago, and no pull request is open. Open
livepeer/task-runner#115 · 3 comments · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
livepeer/task-runner#108 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
livepeer/task-runner#105 ·
All issues in livepeer/task-runner
Similar issues
-
self-host checker: E021 bound check reads an untyped literal at i32, not the type the call bindsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
JakeChampion/lang#11055 ·
Maintainers usually reply within 1 day
-
priority: low status: ready for dev
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
hyperledger-labs/fabric-smart-client#2033 ·
Maintainers usually reply within 1 day
-
agent-butler-finding agent-research bug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
jordansmall/spindrift#4249 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
acceptance-tests phase-coding schema-coverage testing triaged
Difficulty 2/5 1-2 days Newbie friendliness 84/100
elastic/terraform-provider-elasticstack#5053 ·
Maintainers usually reply within 1 day