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

inlet timestamp post processing could lead to timeout_error if using custom TimeUpdateInterval #173

Open
cboulay opened this issue Jul 7, 2022 · 0 comments

Comments

@cboulay
Copy link
Collaborator

cboulay commented Jul 7, 2022

Prompted by a conversation with a user in Slack (whose issue turned out to be firewall blocking UDP), I discovered that clock offset post-processing uses a default timeout of 5.0 seconds. At least I think that's what's going on here:

postprocessor_([this]() { return time_receiver_.time_correction(5); },

If a user uses lsl_api.cfg and sets TimeUpdateInterval to >= 5.0 then there's a good chance that on the first pull the inlet will timeout while waiting for the clock offset.

if (!timeoffset_available()) {
// start thread if not yet running
if (!time_thread_.joinable()) time_thread_ = std::thread(&time_receiver::time_thread, this);
// wait until the timeoffset becomes available (or we time out)
if (timeout >= FOREVER)
timeoffset_upd_.wait(lock, timeoffset_available);
else if (!timeoffset_upd_.wait_for(
lock, std::chrono::duration<double>(timeout), timeoffset_available))
throw timeout_error("The time_correction() operation timed out.");
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant