Skip to content

Commit

Permalink
reinstated multiple enumration on retry
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrasseur-aneo committed Jun 27, 2023
1 parent 3e03227 commit 3c1a904
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions Client/src/Common/Submitter/BaseClientSubmitter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,28 +224,27 @@ private IEnumerable<string> ChunkSubmitTasksWithDependencies(IEnumerable<Tuple<s
{
using var _ = Logger?.LogFunction();

var requests = payloadsWithDependencies.Select(pwd =>
{
var taskRequest = new TaskRequest
{
Payload = UnsafeByteOperations.UnsafeWrap(pwd.Item2),
};
taskRequest.DataDependencies.AddRange(pwd.Item3 ?? Enumerable.Empty<string>());
taskRequest.ExpectedOutputKeys.Add(pwd.Item1);
return taskRequest;
})
.ToList();

for (var nbRetry = 0; nbRetry < maxRetries; nbRetry++)
{
try
{
using var channel = channelPool_.GetChannel();
var submitterService = new Api.gRPC.V1.Submitter.Submitter.SubmitterClient(channel);

//Multiple enumeration occurs on a retry
var response = submitterService.CreateTasksAsync(SessionId.Id,
taskOptions ?? TaskOptions,
requests)
payloadsWithDependencies.Select(pwd =>
{
var taskRequest = new TaskRequest
{
Payload = UnsafeByteOperations.UnsafeWrap(pwd.Item2),
};
taskRequest.DataDependencies
.AddRange(pwd.Item3 ?? Enumerable.Empty<string>());
taskRequest.ExpectedOutputKeys.Add(pwd.Item1);
return taskRequest;
}))
.ConfigureAwait(false)
.GetAwaiter()
.GetResult();
Expand Down

0 comments on commit 3c1a904

Please sign in to comment.