Skip to content

timeout is not reset #123

@gerritholl

Description

@gerritholl

Describe the bug

The timeout feature introduced in #104 is not getting reset properly. The code checks for a timeout in the copy of the worker dict, but this has just been deleted from there:

                        signal.setitimer(signal.ITIMER_REAL,
                                         cwrk.pop("timeout"))
                    cwrk.pop('fun')(job, **cwrk)
                    if "timeout" in cwrk:
                        signal.alarm(0)  # cancel the alarm

To Reproduce

(will add later)

# Your code here

Expected behavior

Timeout should be reset.

Actual results

Timeout is not reset, which means the next or next next plugin may be interrupted due to the earlier timeout still being active.

Environment Info:

  • Trollflow2 Version: main

Additional context

The problem is masked if the next plugin also uses a timeout, because setting a new signal replaces the previous one. That's why I (Gerrit) never realised the problem, but it's quite clear that it exists reading the source code.

Writing unit tests for this is a little bit tricky.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions