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
Is your feature request related to a problem? Please describe.
tower_fallback::service and tower_fallback::future implement some complex poll_ready/call state handling between two services, which is particularly risky if either of those services are Buffered or Batched. This state handling happens across both modules.
The current code appears to be correct, but the Buffer/Batch constraints are undocumented. It also depends on the modules remaining in sync.
Here are the underlying issues:
If lots of tasks with data dependencies use a Buffer or Batch with a small bound, Zebra can hang.
Buffers or Batches with small bounds can also limit concurrency, particularly if the underlying service does a lot of work in its call.
Describe the solution you'd like
Document the internal states of tower_fallback::future
Document how tower_fallback avoids these risks with Buffered or Batched services
Describe alternatives you've considered
Do nothing. If callers use tower-fallback incorrectly, they may hang.
Additional context
See #1593 for the overall Buffer and Batch hang issue, analysis, and design patterns.
The text was updated successfully, but these errors were encountered:
teor2345
changed the title
Refactor or Document the poll_ready/call constraints on tower_fallback
Document the poll_ready/call constraints on tower_fallback
Feb 15, 2021
This task has been revised based on the fixes to the underlying Buffer issue, see #1593 for details.
teor2345
changed the title
Document the poll_ready/call constraints on tower_fallback
Document the Buffer/Batch hang risk on tower_fallback
Feb 15, 2021
teor2345
changed the title
Document the Buffer/Batch hang risk on tower_fallback
Document the Buffer/Batch constraints on tower_fallback
Feb 15, 2021
Is your feature request related to a problem? Please describe.
tower_fallback::service
andtower_fallback::future
implement some complexpoll_ready
/call
state handling between two services, which is particularly risky if either of those services areBuffer
ed orBatch
ed. This state handling happens across both modules.The current code appears to be correct, but the
Buffer
/Batch
constraints are undocumented. It also depends on the modules remaining in sync.Here are the underlying issues:
Buffer
orBatch
with a small bound, Zebra can hang.Buffer
s orBatch
es with small bounds can also limit concurrency, particularly if the underlying service does a lot of work in itscall
.Describe the solution you'd like
tower_fallback::future
tower_fallback
avoids these risks withBuffer
ed orBatch
ed servicesDescribe alternatives you've considered
Do nothing. If callers use
tower-fallback
incorrectly, they may hang.Additional context
See #1593 for the overall
Buffer
andBatch
hang issue, analysis, and design patterns.The text was updated successfully, but these errors were encountered: