-
Notifications
You must be signed in to change notification settings - Fork 47
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
LabRecorder deadlocks writing a streams footer, if it has not yet received anything from this stream #9
Comments
Definitely a bug, I was already looking into something related to this but a stream without data is a lot easier to reproduce. |
Hey I just uncovered this bug myself, the problem is that the calls to pull_sample and pull_chunk_multiplexed do not provide a timeout parameter, therefore they go by the LSL default which is "FOREVER". Therefore the typed_transfer_loop never checks or re-checks the shutdown flag, so the thread doesn't finish properly. Obviously if you actually have data for the inlet to pull, the code won't hang on the pull calls, but for a "dead" stream, it just keeps waiting.
|
@tstenner I just finished doing a PR for the console message stuff and noticed that your commit fded925 has a potential bug.
Since you are in a while loop and pull_sample keeps returning 0.0, you will get stuck in this loop during shutdown since you don't also check the shutdown state. It should be:
|
You're right, I fixed it. |
We're still getting this bug. |
@cboulay I've fixed the status bar kb-written bug: //mainwindow.cpp line 91 should be
auto fileinfo = QFileInfo(ui->rootEdit->text()+QDir::separator()+recFilename); |
@xbbsky That didn't do much for me because it turns out that the file size wasn't incrementing. When I reduced the timeout parameter then everything seemed to fall in place. Thanks for your comment on that commit. |
Maybe there's still some discussion to be had as to what the timeout parameter should be, but the bug as described in this issue is fixed. |
I also experienced this issue again recently and setting a low value for timeout definitely fixed it. However, I don't really understand why it fixed the issue since the timeout was only a few seconds previously. Also, I may just be crazy but I remember the previous fix (with checking the shutdown parameter) as having resolved this issue for me before the holiday. Now it's a few weeks later and my recent tests weren't shutting down properly. It's like this issue cropped up again out of the blue. |
I noticed that LabRecorderCLI won't shut down after sending
process.communicate('b\n')
(or pressing Enter when run from a terminal). Instead it hung atOffsets thread is finished
. The same happens with LabRecorder.exe. I could trace it to the fact that it was waiting for a stream which has not yet send any sample. Once i sent a sample, it would write the footer for the stream, close the xdf-file and return.Don't know whether bug or feature, but probably worthwile to know.
The text was updated successfully, but these errors were encountered: