Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revamp TaskResult of UnifiedAPI #93

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

lemaitre-aneo
Copy link
Contributor

No description provided.

Logger?.LogTrace("Response handler for {taskId}",
resultStatusData.TaskId);

var result = ProtoSerializer.DeSerializeMessageObjectArray(byteResult);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe distinguish between error from deserializing and handler execution ?

var resultStatusCollection = SessionService.GetResultStatus(bucket);
if (ResultHandlerDictionary.IsEmpty)
{
Thread.Sleep(100);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary ?

# Conflicts:
#	UnifiedApi/Client/Services/Submitter/Service.cs
@lemaitre-aneo lemaitre-aneo changed the base branch from next to main December 13, 2022 09:44
var resultStatusCollection = SessionService.GetResultStatus(bucket);
if (ResultHandlerDictionary.IsEmpty)
{
Thread.Sleep(100);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use WaitInSeconds Array line 271 rather than a hard coded value. 10 ms is slightly enough

ResultId = resultStatusData.ResultId,
Session = SessionId,
},
CancellationToken.None)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No usage of CancellationResultTaskSource.Token instead of CancellationToker.None ?

Comment on lines +344 to +346
Logger?.LogError(e2,
"An exception was thrown while handling a previous exception in the result handler of {taskId}",
taskId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-throw exception here. User process should stop here since they don't manage properly the exception

Comment on lines +390 to +393
ResultHandlerDictionary[resultStatusData.TaskId]
.HandleError(new ServiceInvocationException(details,
statusCode),
resultStatusData.TaskId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add specific Try catch to manage Handle error ?

Comment on lines +365 to +370
taskStatus = SessionService.GetTaskStatus(resultStatusData.TaskId);
if (!StatusCodesLookUp.TryGetValue(taskStatus,
out var statusCode))
{
statusCode = ArmonikStatusCode.Unknown;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add specific exception for GetTaskStatus Grpc Request and call HandleError with Connection error exception if an exception occurs

Thread.Sleep(waitInSeconds[emptyFetch]);
emptyFetch = fetched == 0
? Math.Min(emptyFetch + 1,
waitInSeconds.Length)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it waitInSeconds.Length - 1 instead ?

@aneojgurhem
Copy link
Contributor

@lemaitre-aneo do we continue or close ?

@lemaitre-aneo
Copy link
Contributor Author

@lemaitre-aneo do we continue or close ?

I don't know. I still think the change is relevant, but there was a slow down introduced by this change and I don't know where. We could close it and re-open it if we have more insight.

@aneojgurhem
Copy link
Contributor

We can wait for the new developments and we can try again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Revamp ResultTask in Extension.Csharp
3 participants