Skip to content

Fix VirtualClusterRequestInvoker async path and TestableDateTimeProvider.DeadTime#195

Merged
Mpdreamz merged 2 commits into
mainfrom
fix/virtual-cluster-connection-async
Feb 23, 2026
Merged

Fix VirtualClusterRequestInvoker async path and TestableDateTimeProvider.DeadTime#195
Mpdreamz merged 2 commits into
mainfrom
fix/virtual-cluster-connection-async

Conversation

@Mpdreamz

Copy link
Copy Markdown
Member

RequestAsync previously wrapped the sync Request in Task.FromResult, which
meant PostData.StreamHandler's async writer was never invoked — leaving
RequestBodyInBytes empty for callers using the async transport path.

Now RequestAsync is truly async with its own HandleRulesAsync chain that
calls InMemoryRequestInvoker.BuildResponseAsync (and thus PostData.WriteAsync).

Also implement TestableDateTimeProvider.DeadTime with exponential backoff
matching DefaultDateTimeProvider instead of throwing NotImplementedException,
which crashed when content-type mismatches caused the transport to mark a
node as dead.

Co-authored-by: Cursor cursoragent@cursor.com

Mpdreamz and others added 2 commits February 23, 2026 19:09
…der.DeadTime

RequestAsync previously wrapped the sync Request in Task.FromResult, which
meant PostData.StreamHandler's async writer was never invoked — leaving
RequestBodyInBytes empty for callers using the async transport path.

Now RequestAsync is truly async with its own HandleRulesAsync chain that
calls InMemoryRequestInvoker.BuildResponseAsync (and thus PostData.WriteAsync).

Also implement TestableDateTimeProvider.DeadTime with exponential backoff
matching DefaultDateTimeProvider instead of throwing NotImplementedException,
which crashed when content-type mismatches caused the transport to mark a
node as dead.

Co-authored-by: Cursor <cursoragent@cursor.com>
…sync path

BuildResponseAsync was missing the final ?? BoundConfiguration.DefaultContentType
fallback that BuildResponse (sync) had, causing null content-type on async
responses when neither an explicit nor constructor content-type was provided.
This led to content-type mismatch audit events that broke sync/async audit
trail parity in virtual cluster tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Mpdreamz Mpdreamz merged commit 1bfa90f into main Feb 23, 2026
7 checks passed
@Mpdreamz Mpdreamz deleted the fix/virtual-cluster-connection-async branch February 23, 2026 18:25
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