aneoconsulting / ArmoniK

Main repository for ArmoniK, An Open-Source orchestrator based on Kubernetes managing the distribution of hybrid multi cloud computations
https://aneoconsulting.github.io/ArmoniK/
Apache License 2.0
25 stars 16 forks source link

problem during sending buffer #977

Closed landdragon closed 1 year ago

landdragon commented 1 year ago

Describe the bug I have a client who is stuck into the send of all task. I think the problem is inside the send of buffer.

To Reproduce It is not easy to reproduce

Expected behavior Not be stuck :)

Infra

I already explain the problem to @ddubuc

ngruelaneo commented 1 year ago

@landdragon Thank you very much for the report, unfortunately @ddubuc is not available today so can you describe with more details in this issue the problem so the team can try to solve it.

landdragon commented 1 year ago

hello,

here we have a method used inside a thread and in case of throw the thread is kill and we are stuck. we continue to send message inside the SubmitAsync and we await the send to the grid but the thread who send to the grid is off.

landdragon commented 1 year ago

and so if it throw I will need a log and a managment of error like a continue, restart or crash the application

dbrasseur-aneo commented 1 year ago

@landdragon Can you provide a way to reproduce the issue ? It would be easier for us.

ddubuc commented 1 year ago

Need to fix forward Issue

ddubuc commented 1 year ago

@landdragon : To review the fix in 0.10.1 https://github.com/aneoconsulting/ArmoniK.Extensions.Csharp/pull/158

To compare with 0.8.2 (2.10.2) https://github.com/aneoconsulting/ArmoniK.Extensions.Csharp/compare/0.8.2...ddu/backPort_BufferException

landdragon commented 1 year ago

Just the re throw of the exception you put throw e; it is better to encapsulate inside an new exception otherwise we will lost the stack trace

ddubuc commented 1 year ago

@landdragon Are you taking about this line ? https://github.com/aneoconsulting/ArmoniK.Extensions.Csharp/blob/7c5c67329538f17adc31fbc7c5a10fa4fe5e6fdb/Client/src/Common/Submitter/RequestTaskMap.cs#L66

landdragon commented 1 year ago

yes

ddubuc commented 1 year ago

@landdragon So the idea for you is as below ?

  /// <summary>
  ///   Get the correct taskId based on the SubmitId
  /// </summary>
  /// <param name="submitId">The submit Id push during the submission</param>
  /// <returns>the async taskId</returns>
  public async Task<string> GetResponseAsync(Guid submitId)
  {
    while (!dictionary_.ContainsKey(submitId))
    {
      await Task.Delay(WaitTime);
    }

    return dictionary_[submitId]
      .IfRight(e => throw new ClientApiException("Submission failure", e));
  }
landdragon commented 1 year ago

nice :)