private IEnumerable <Task> _executeAsync(TaskCompletionSource <HttpStatusCode> tcs, int instance, Proposal <string, SerialilzableWebRequest> proposal) { Action <string> trace = s => FUSE.Paxos.Events.TraceInfo(s, proposal.guid, _paxos.Self, instance, proposal.value.Headers["x-ms-client-request-id"] ?? ""); trace("ExecuteAsync Enter"); var getResponseTask = Concurrency.RetryOnFaultOrCanceledAsync <HttpWebResponse>(() => GetResponse(proposal.value), t => ShouldRetryGetResponse(t, instance, proposal.guid), 1000); yield return(getResponseTask); trace("ExecuteAsync ResponseReceived"); if (!proposal.value.Method.Equals("GET", StringComparison.InvariantCultureIgnoreCase)) { var logTask = Concurrency.RetryOnFaultOrCanceledAsync(() => LogResultAsync(instance), _ => true, 1000); yield return(logTask); try { logTask.Wait(); trace("ExecuteAsync Logged"); } catch (Exception e) { Validation.TraceException(e, "Exception incrementing LSN"); } } TaskCompletionSource <HttpWebResponse> completion; if (completions.TryGetValue(proposal.guid, out completion)) { completion.SetFromTask(getResponseTask); completions.Remove(proposal.guid); } tcs.SetResult(GetStatusCode(getResponseTask)); trace("ExecuteAsync Exit"); }