Bug 8011 - Timeouts can trigger when they no longer are relevant
Summary: Timeouts can trigger when they no longer are relevant
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Misc (show other bugs)
Version: 4.14.0
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.15.0
Assignee: Linn
Keywords: frifl_tester, prosaic
Depends on:
Reported: 2022-10-21 14:06 CEST by Linn
Modified: 2022-11-09 16:19 CET (History)
1 user (show)

See Also:
Acceptance Criteria:


Description Linn cendio 2022-10-21 14:06:52 CEST
In httpserver.py we use timeouts for ensuring that communication with the client does not take too long time - if it does, we abort the request. However, we do not deactivate the timer once the call in question has finished, meaning that the timeout can trigger despite it no longer being relevant.

When monitoring a call, we should also make sure to deactivate the monitoring once it has finished.
Comment 2 Linn cendio 2022-10-25 16:54:22 CEST
Tested by starting a timeout and calling sleep() to trigger it, and could see that cancelling the timeout caused the "true" error message to be logged instead of the less interesting timeout error.

Tester should note that the main issue of this bug is that timeouts can trigger in exception handling, which then can hide error messages by only displaying a message about timeout error.
Comment 4 Frida Flodin cendio 2022-11-09 16:19:53 CET
I can verify that this works as expected. This is what I tested, both for the tls handshake and the request timeout:

1. Set timeout
2. Call the function we are monitoring
3. The function raises an exception*
4. Add sleep() in the exception handling code*

*Had to put in some bad code to trigger the behavior. 

Then I checked the logs and could see that before there was no informative error message. Now there is. The timeout is now cancelled both when everything worked fine and when there is an exception.

Note You need to log in before you can comment on or make changes to this bug.