Skip to content

Simplify Future for RequestDispatch#554

Open
stepancheg wants to merge 1 commit intogoogle:mainfrom
stepancheg:future-for-dispatch
Open

Simplify Future for RequestDispatch#554
stepancheg wants to merge 1 commit intogoogle:mainfrom
stepancheg:future-for-dispatch

Conversation

@stepancheg
Copy link
Copy Markdown
Contributor

@stepancheg stepancheg commented Mar 25, 2026

Remove field terminal_error.

If I understand this code correctly, terminal_error field is used only between run returned with error and immediately after on the next iteration of the loop before exiting the future: locally to the future poll.

The context is this: terminal_error only works for inflight requests, but this is not enough to provide good diagnostics if we are sending request to a dispatch which has already failed.

Instead, there can be a field like Arc<OnceCell<SomeError>> shared between dispatch and channel, so that if writing to channel or reading back from oneshot channel fails, we could attach that error as error source.

So I start by cleaning up existing code.

@stepancheg stepancheg force-pushed the future-for-dispatch branch from 4fbd5aa to 2b4f63b Compare March 25, 2026 19:02
@stepancheg stepancheg force-pushed the future-for-dispatch branch from 2b4f63b to 728d8af Compare March 25, 2026 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant