-
Notifications
You must be signed in to change notification settings - Fork 390
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
icehello example may happen bug when system time rollback #1292
Comments
We used iceoryx in TDA4, but in TDA4 sometimes happend system time rollback in few days, and then ice will throw exception. So I try it in x86 Linux, and it also happened, need help. |
I think we never considered this use case and I think this is something iceoryx does not support. The reason is that we have cyclic task which run with a defined period. Here we use functions which are Stuff like this can happen:
We use internal timers which wait for requests (for instance when you create/destroy ports like the subscriber/publisher) Iceoryx does not support a change of the time while it is running. When it is working then it is just by accident. I will investigate this further and keep this as a bug open. But please do not count on a quick fix in the next days! For the time being I sadly can only recommend to not change the system time while iceoryx is running. |
Thanks for the analysis, that's enough. I haven't delved into iceoryx at the moment, I just want to know why it crashes in this case now. and then I'll try to look into iceoryx. |
I fixed this bug by modified "iceoryx_posh_types.hpp : 254" Will it affect other modules? |
@1su I don't think this is a viable solution. The system clock has the issue that it can be changed by the user while the steady clock should only monotonically increase |
But using this approach does solve the problem |
@1su1 it may solve your specific problem but creates another one. The steady clock is not supposed to change and therefore that one is used. I'm not even sure why this problem happens on your side since you wrote that there is a system time rollback. Is this correct or is there be steady clock reset? A proper fix for this would be to refactor the liveliness detection to not rely on any timestamps (#1361) since this also makes debugging harder. A quick fix for you would be to disable the monitoring and start RouDi with |
@1su1 @elBoberido The system time rollback will cause m_keepAliveTask to work abnormally, because the underlying part of m_keepAliveTask uses sem_timedwait to delay sending keeplive packets.I have now changed to using std::this_thread::sleep_for to delay sending the keeplive package while adapting to thread exit logic. The test results are normal. |
inline void PeriodicTask::run() noexcept |
@elfenpiff I've met the same issue, when time rollback on version 2.0.3. I guess this issue may be related to the different clocks used by roudi & helloworld apps. Roudi use steady_clock when checking keepAlive signal, while helloworld apps use PeriodicTask to send keepAlive signal which use TimeSpecReference::Epoch. |
@wjswjq This is sadly not so easily possible since the posix semaphore does not support monotonic clocks in I think we have to use here |
Required information
Operating system:
E.g. Ubuntu 20.04.3 LTS
Compiler version:
E.g. gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Observed result or behaviour:
Expected result or behaviour:
When system time rollback happened, all as usual.
Conditions where it occurred / Performed steps:
The text was updated successfully, but these errors were encountered: