The interval flow operator deadlocks when passing in caf::timespan::zero() for the max_delay argument.
We tracked it down to the loop in this code which never finishes when period_ <= timespan::zero():
|
auto now = parent_->steady_time(); |
|
auto next = last_ + period_; |
|
while (next <= now) |
|
next += period_; |
|
last_ = next; |
|
schedule_next(next); |
Besides the interval operator, this also affects the buffer operator and the to_stream and to_typed_stream methods on observables, which use interval internally.
I think the following changes should be made to fix the issues:
- The
interval and buffer should assert that max_delay >= timespan::zero() holds true.
- The
to_stream and to_typed_stream methods should support an unbuffered mode where they do not even attempt to create the interval operator.
The
intervalflow operator deadlocks when passing incaf::timespan::zero()for themax_delayargument.We tracked it down to the loop in this code which never finishes when
period_ <= timespan::zero():actor-framework/libcaf_core/caf/flow/op/interval.cpp
Lines 72 to 77 in 06ed712
Besides the
intervaloperator, this also affects thebufferoperator and theto_streamandto_typed_streammethods on observables, which useintervalinternally.I think the following changes should be made to fix the issues:
intervalandbuffershould assert thatmax_delay >= timespan::zero()holds true.to_streamandto_typed_streammethods should support an unbuffered mode where they do not even attempt to create the interval operator.