Skip to content

Commit

Permalink
Fix race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
adamreeve committed Oct 11, 2024
1 parent f2e34a2 commit ed02950
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@ private static async Task UploadBatches(FlightClient client, FlightDescriptor de
{
await writer.CompleteAsync().ConfigureAwait(false);
}

// Drain the response stream to ensure the server has stored the data
var hasMore = await putCall.ResponseStream.MoveNext().ConfigureAwait(false);
if (hasMore)
{
throw new Exception("Expected to have reached the end of the response stream");
}
}

private static async Task ConsumeFlightLocation(FlightClient client, FlightTicket ticket, RecordBatch[] batches)
Expand Down

0 comments on commit ed02950

Please sign in to comment.