Skip to content

Commit

Permalink
Revert marking response timeout after send.
Browse files Browse the repository at this point in the history
Caused way to many thread contentions.  Needs to be rethought.
  • Loading branch information
Jroland committed Apr 10, 2015
1 parent addc9c1 commit c307569
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/kafka-net/KafkaConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,9 @@ public async Task<List<T>> SendAsync<T>(IKafkaRequest<T> request)

try
{
var sendTask = SendAsync(request.Encode());
//synchronously add the response message as soon as the send succeeds. If the KafkaTcpSocket is trying establish a connection
//the SendAsync call will block until its establish. If we added response to queue before, it would timeout seperately from the send.
sendTask.ContinueWith(t => AddAsyncRequestItemToResponseQueue(asyncRequest), TaskContinuationOptions.ExecuteSynchronously);
AddAsyncRequestItemToResponseQueue(asyncRequest);

await sendTask.ConfigureAwait(false);
await SendAsync(request.Encode()).ConfigureAwait(false);
}
catch (OperationCanceledException ex)
{
Expand Down

0 comments on commit c307569

Please sign in to comment.