Open jrudolph opened 7 years ago
@jrudolph I'm still wondering if the current PoolSlot
PoolConductor
complication is worth it. Trying to manage that state across the two stages is prooving to be quite difficult to get correct and is only real purpose is to support pipelining which it does poorly anyhow (I'm fairly sure it works correctly for idempotent requests but if there are any non-idempotent requests in the flow its broken).
I haven't really thought it through fully but my feeling was if PoolSlot
could start managing its demand based on that state then the non-pipeline model would be much simpler. I'm not sure how to solve pipeling in that model though - perhaps its just a case that if PoolSlot
pulls a non-idempotent request then it buffers it until its downstream is complete (including retries and reconnections). That wouldn't give ideal scheduling but then pipeling is known to give non-ideal scheduling since head of queue will block anyhow.
I guess any kind of simplification would be nice. We should gather requirements first to make sure we know what features we'd need.
Here's a small list from the top of my head:
See also https://github.com/akka/akka-http/issues/299 with possible bug coming from timing of operations.
Follow up to #416 / #481.
With @gosubpl's change implemented in #481 we might end up in a situation where after response entity stream error the PoolConductor thinks a PoolSlot is in a different state.
@leachbj summarized it like this:
We might want to improve this situation in the future as suggested in https://github.com/leachbj/akka-http/commit/516f997b94fb980a1a4b314ed3bd4c5b49a9597d.
On the other hand, there's always a race going on between a PoolSlot notifying the conductor of its current state vs. the conductor already handling a new request based on the old state. I.e. we know that there's not a perfect sync. As long as a slot cannot get stuck we might just accept temporary inaccuracies. We should also take into account how enabling pipelining could change the state machine sync.