Skip to content
This repository was archived by the owner on Oct 31, 2023. It is now read-only.

Task initialization failure sets incorrect task state #4850

Closed
nieznanysprawiciel opened this issue Nov 4, 2019 · 3 comments
Closed

Task initialization failure sets incorrect task state #4850

nieznanysprawiciel opened this issue Nov 4, 2019 · 3 comments
Assignees
Labels
bug important P3 Severity-Low/Effort-hard

Comments

@nieznanysprawiciel
Copy link
Contributor

nieznanysprawiciel commented Nov 4, 2019

Description

If Golem task initialization fails (for example initialize function throws exception), task state will be set to creating for always.

Golem Version:
current develop

OS [e.g. Windows 10 Pro]:
Ubuntu (but it shouldn't matter)

Branch (if launched from source):
develop

Description of the issue:

Golem catches exception properly, but it is handled by decorator which seems to be outdated.
Problem occures in task_creation_failed taskmanager.py line 240, where task_id parameter is set to None. This function got None, because _create_task_error decorator, which handles exceptions, tried to get task_id from task_dict. But task_dict doesn't have id, only task_definition does.

Steps To Reproduce

  1. Add throw statement to initialize function of any task (I tested it on transcoding use case, but should work with blender task either)
  2. Request task.
  3. Observe results: Golem will create task, assign id to it, but than you will see in logs: Cannot create task. task_id=None.
  4. If you break somewhere with debugger you will see, that task status remained creating

Expected behavior

I expect that task result will be set to errorCreating.

Logs and any additional context

INFO     [golem.task.rpc                     ] Creating task. task_dict={'type': 'FFMPEG', 'compute_on': 'cpu', 'name': 'Transcoding id 37', 'timeout': '00:30:00', 'subtask_timeout': '00:10:00', 'subtasks_count': 1, 'bid': 1, 'resources': ['/home/nieznanysprawiciel/Repos/Golem/transcoding-demo/Storage/r_25/tmp2_sptvs5'], 'options': {'output_path': '/home/nieznanysprawiciel/Repos/Golem/transcoding-demo/Storage/r_25/37', 'output_filename': 'Golem-timelapse-03-mpeg4-fullHD_1920x1080_vp9.webm', 'container': 'webm', 'video': {'resolution': [1920, 1080], 'codec': 'vp9'}}}
INFO     [golem.task.taskmanager             ] Creating task. type=<class 'apps.transcoding.ffmpeg.task.ffmpegTask'>, id=043fed28-ff16-11e9-868b-dc2e10f8d3e6
INFO     [golem.environments.environmentsmanager] Adding environment FFMPEG supported=<SupportStatus ok ({})>
INFO     [golem.network.p2p.peersession      ] Starting peer session. address=94.23.196.166:40102
INFO     [apps.transcoding.ffmpeg.utils      ] Stream /home/nieznanysprawiciel/Repos/Golem/transcoding-demo/Storage/r_25/tmp2_sptvs5 has successfully passed the extract+split operation. Segments: ['/home/nieznanysprawiciel/Data/GolemData/Requestor1/rinkeby/ComputerRes/043fed28-ff16-11e9-868b-dc2e10f8d3e6/tmp/output/tmp2_sptvs5[video-only]_0']
ERROR    [golem.task.taskmanager             ] Cannot create task. task_id=None : Debug throw
@etam
Copy link
Contributor

etam commented Nov 28, 2019

meme

@etam
Copy link
Contributor

etam commented Nov 28, 2019

this is caused by #4324

@etam
Copy link
Contributor

etam commented Dec 9, 2019

#4951 was merged to b0.22

@etam etam closed this as completed Dec 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug important P3 Severity-Low/Effort-hard
Projects
None yet
Development

No branches or pull requests

4 participants