-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add timeouts so missing/idle streams can't prevent LabRecorder from s…
…hutting down. Thanks to Jason Kowaleski (@kowalej)
- Loading branch information
Showing
1 changed file
with
4 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fded925
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in line 385,
in->pull_chunk_multiplexed(chunk, ×tamps, 4.0)
, the parametertimeout=4.0
makes this line kind of a dead loop. This prevents the write data process and makes thechunk
too big. Thetimeout
here should be0.0
.fded925
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xbbsky It's needed because we need to check if the shutdown flag was set periodically and without a timeout this will only happen once a chunk was received and hang otherwise
fded925
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So here the timeout should be a very small value, such as
1e-6
.4.0
is too big.fded925
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes a lot of problems for me.
@tstenner How can I test for the scenario that the timeout was trying to address? Do I make a stream that isn't closed but isn't pushing anything?
fded925
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cboulay I think I committed an example app that creates an outlet without sending data, but I don't know if pushed it to the examples repo
fded925
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4.0 is probably too big, but it shouldn't be less than a second.
fded925
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure that units are seconds? I didn't wait a full 4 minutes, but I wanted longer than 30 seconds and the app remained frozen until the remote streams were closed and LabRecorder caught an exception.
fded925
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All LSL doubles are in seconds, so unless pull_chunk does something wrong it should be a maximum of 4 seconds.
fded925
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then it's doing something wrong because it's much longer than 4 seconds.
fded925
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, I'll take care of it.