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

timeout is not reset #123

Open
gerritholl opened this issue Oct 26, 2021 · 0 comments
Open

timeout is not reset #123

gerritholl opened this issue Oct 26, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@gerritholl
Copy link
Member

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.

@gerritholl gerritholl self-assigned this May 23, 2023
@gerritholl gerritholl added the bug Something isn't working label May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant