-
Notifications
You must be signed in to change notification settings - Fork 297
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
Fix: correlation test fail except for external event with extended session #430
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for debugging this, and sorry that I broke it when merging changes. :(
The change I introducedExternal Event test was failed. The reason was, the old version as false positive. ExecutionStarted and EventRaiseEvent is coming at the same time, It works. However, ExecutionStated and EventRaiseEvnet coming as different timing, EventRaiseEvent's one can not find the parent trace context. I put the traceContext on ExecutionStarted to trackingStore. If the EventRaiseEvent happens, and the ParentTraceContext is empty, I restored the context from the tracking Store.
Point of the ReviewWhat I'm not sure how an Orchestrator with RaiseEvent find the your orchestrator's ExecutionStarted history? |
src/DurableTask.AzureStorage/AzureStorageOrchestrationService.cs
Outdated
Show resolved
Hide resolved
CorrelationTraceClient.Propagate(() => | ||
{ | ||
var traceContext = CorrelationTraceContext.Current; | ||
historyEntity.Properties["Correlation"] = new EntityProperty(traceContext.SerializableTraceContext); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How large do you think this data will be? I think you should also update estimatedBytes
here so that we don't overflow the maximum batch size for Azure Tables.
Also, please update the AzureTableTrackingStore.VariableSizeEntityProperties
array by adding your new "Correlation" property name so that we can correctly keep track of whether we need to compress the data and upload it to blob storage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, since you added the Correlation
property to the history event class in DurableTask.Core, I don't think you need to do this at all. Just assign it to ExecutionStartedEvent.Correlation
and we will use reflection to put it into table storage. In fact, would it make more sense to assign the Correlation property in the DurableTask.Core project? It seems like you don't actually need to do anything specific in DurableTask.AzureStorage for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done for estimatedBytes
and AzureTableTrackingStore.VariableSizeEntityProperties
However, I couldn't figure out where should I updated ExecutionStartedEvent.Correlation
It is not here, right? Today is times up, I'll try tomorrow, however, If you know where it is, please let me know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/DurableTask.AzureStorage/AzureStorageOrchestrationService.cs
Outdated
Show resolved
Hide resolved
src/DurableTask.AzureStorage/AzureStorageOrchestrationService.cs
Outdated
Show resolved
Hide resolved
What I've done
TODOWhere should I insert the
I might read more code releated |
src/DurableTask.AzureStorage/AzureStorageOrchestrationService.cs
Outdated
Show resolved
Hide resolved
src/DurableTask.AzureStorage/Tracking/AzureTableTrackingStore.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Chris Gillum <[email protected]>
Co-authored-by: Chris Gillum <[email protected]>
@cgillum |
Hi @cgillum
I found the root cause why the correlation test fails.
TaskHubClient
changes the behavior.CorrelationTraceClient.Propagate(() => CreateAndTrackDependencyTelemetry(requestTraceContext));
Should be coming before a method that eventually call theTaskHubQueue
.This is the old code.
https://github.com/TsuyoshiUshio/durabletask/blob/correlation/final/src/DurableTask.Core/TaskHubClient.cs#L497-L501
TODO
Only the External Event with non-extended session will fail. I'm not fully understand the new behavior, however, it is getting very close.