You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As we're trying to implement extended temperature-based shutdown we've stumbled at this behavior in pdm:
Method watch->callback(Context::START) is called on program start from main() function in main.cpp in a loop: for (auto& watch : ConfigPropertyWatches::get());
If there was any condition in yaml file with defer attribute, a DeferrableCallback is created for it. operator() is called then for DeferrableCallback on program start with Context::START as an argument;
Object timer is created on the first operator() call in DeferrableCallback. The argument to operator(), which is Context::START, is passed to the timer constructor and is saved there;
Timer's context is not changed on subsequent calls to operator();
When the timer expires, it calls operator() with the saved Context::START context, always;
If the next callback is a DBus method call, the context is not checked and the method is called, but if the next callback is ElogWithMetadataCapture, the context is checked and the method is not called for Context::START
Due to that, we now can not log sensor threshold crossing if we want to do it with a delay and an extra check for persistence of the condition.
We'd like to know if it's a bug or an intended behavior? Maybe we must use some different approach to logging/acting on threshold crossing?
The text was updated successfully, but these errors were encountered:
As we're trying to implement extended temperature-based shutdown we've stumbled at this behavior in pdm:
watch->callback(Context::START)
is called on program start frommain()
function in main.cpp in a loop:for (auto& watch : ConfigPropertyWatches::get())
;defer
attribute, aDeferrableCallback
is created for it.operator()
is called then forDeferrableCallback
on program start withContext::START
as an argument;timer
is created on the firstoperator()
call inDeferrableCallback
. The argument tooperator()
, which isContext::START
, is passed to the timer constructor and is saved there;operator()
;timer
expires, it callsoperator()
with the savedContext::START
context, always;ElogWithMetadataCapture
, the context is checked and the method is not called forContext::START
Due to that, we now can not log sensor threshold crossing if we want to do it with a delay and an extra check for persistence of the condition.
We'd like to know if it's a bug or an intended behavior? Maybe we must use some different approach to logging/acting on threshold crossing?
The text was updated successfully, but these errors were encountered: