Actions
Bug #5638
closedosmo_fsm: osmo_fsm_inst_state_chg() using timeout_secs=0 instead of -1 as "no-timeout"
Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
07/29/2022
Due date:
% Done:
0%
Spec Reference:
Description
<pespin_> just found a big bug in osmo_fsm. Calling osmo_fsm_inst_state_chg() with timeout_secs=0 actually sets no timer... <pespin_> That should be handled with negative values, like -1 <fixeria> pespin_: timeout_secs=0? is it expected to expire immediately? <pespin_> fixeria, that's the idea... but doesn't happen <fixeria> pespin_: but what's the point of doing so? <pespin_> this has some use cases, like doing some stuff immediatelly but asynchronously <fixeria> as a quick hack, you could use osmo_fsm_inst_state_chg_ms() with a small ms value <pespin_> or I can imagine some FSM setting a timeout based on calculations which may end up in 0 <pespin_> yeah I know, but that still doens't fix the fact that some timeout may end up being 0ms too <fixeria> handling timeout_secs=0 as immediate expiration still looks weird to me <pespin_> why? is how any kind of timeout works <fixeria> AFAIR, tnt (or somebody else?) raised the topic of async event handling in osmo_fsm <fixeria> IMO, it would be a lot more readable if we had API for async event dispatching <pespin_> I don't think we can really fix the existing API though, since it's used in lots of places with timeou_secs=0 meaning no timeout... <pespin_> we'd probably need to add a new osmo_fsm_inst_state_chg2 or alike
Actions