From c307569f6d1a2c68fe7a9d9b23c8fdb847dc7953 Mon Sep 17 00:00:00 2001 From: James Roland Date: Fri, 10 Apr 2015 16:31:47 -0700 Subject: [PATCH] Revert marking response timeout after send. Caused way to many thread contentions. Needs to be rethought. --- src/kafka-net/KafkaConnection.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/kafka-net/KafkaConnection.cs b/src/kafka-net/KafkaConnection.cs index e1fc160c..c7d8a732 100644 --- a/src/kafka-net/KafkaConnection.cs +++ b/src/kafka-net/KafkaConnection.cs @@ -109,12 +109,9 @@ public async Task> SendAsync(IKafkaRequest 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) {