main work by @drewhk with contributions from @2m and @rkuhn
This work uncovered many well-hidden bugs in existing Stages, in
particular StatefulStage. These were hidden by the behavior of
OneBoundedInterpreter that normally behaves more orderly than it
guarantees in general, especially with respect to the timeliness of
delivery of upstream termination signals; the bugs were then that
internal state was not flushed when onComplete arrived “too early”.
- ActorProcessor terminated eagerly when ConcatAll had just taken up a
new input stream but not yet received onSubscribe for it
- The ActorProcessor eagerly shuts itself down upon onError and that
cannot be changed without completely reworking the Pump, so I opted
for just tracking the outstanding substreamSubscribers that have not
yet seen OnSubscribe and making them cancel properly when that arrives
(possibly later).