-
Notifications
You must be signed in to change notification settings - Fork 327
Add Poison Message Handling to the Dispatchers #1331
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
Open
sophiatev
wants to merge
9
commits into
main
Choose a base branch
from
stevosyan/add-poison-message-handling
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
de244ff
initial implementation
8f6bf9d
fixing the compilation errors
ea5a36f
addressing copilot comments
3ab0859
Merge branch 'main' into stevosyan/add-poison-message-handling
sophiatev 4c7665d
fixing the error in the logger where I was incorrectly calling Discar…
3bd1dc9
moved the max dispatch count from IOrchestrationService to dispatch p…
2e3c7c2
updated the implementations to remove all exception-throwing in the c…
eecc077
comment updates
f0fc35d
fixed a typo, added an argument range check for the max dispatch count
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,13 +13,15 @@ | |
| #nullable enable | ||
| namespace DurableTask.Core.Logging | ||
| { | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Text; | ||
| using DurableTask.Core.Command; | ||
| using DurableTask.Core.Common; | ||
| using DurableTask.Core.Entities.EventFormat; | ||
| using DurableTask.Core.Entities.OperationFormat; | ||
| using DurableTask.Core.History; | ||
| using Microsoft.Extensions.Logging; | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Text; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we revert the sort order change to this file? Normally we keep |
||
|
|
||
| class LogHelper | ||
| { | ||
|
|
@@ -745,6 +747,42 @@ internal void RenewActivityMessageFailed(TaskActivityWorkItem workItem, Exceptio | |
| this.WriteStructuredLog(new LogEvents.RenewActivityMessageFailed(workItem, exception), exception); | ||
| } | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Logs that a "poison message" has been detected and is being dropped. | ||
| /// </summary> | ||
| /// <param name="orchestrationInstance">The orchestration instance this event was sent to.</param> | ||
| /// <param name="historyEvent">The "poisoned" event.</param> | ||
| /// <param name="details">Extra details related to the processing of this poison message.</param> | ||
| internal void PoisonMessageDetected(OrchestrationInstance? orchestrationInstance, HistoryEvent historyEvent, string details) | ||
| { | ||
| if (this.IsStructuredLoggingEnabled) | ||
| { | ||
| this.WriteStructuredLog(new LogEvents.PoisonMessageDetected( | ||
| orchestrationInstance, | ||
|
sophiatev marked this conversation as resolved.
|
||
| historyEvent.EventType.ToString(), | ||
| Utils.GetTaskEventId(historyEvent).ToString(), | ||
| details)); | ||
| } | ||
|
sophiatev marked this conversation as resolved.
|
||
| } | ||
|
|
||
| /// <summary> | ||
| /// Logs that a "poison" entity request message has been detected and is being dropped. | ||
| /// </summary> | ||
| /// <param name="orchestrationInstance">The orchestration instance this event was sent to.</param> | ||
| /// <param name="requestMessage">The "poisoned" reuest message.</param> | ||
|
sophiatev marked this conversation as resolved.
Outdated
|
||
| /// <param name="details">Extra details related to the processing of this poison message.</param> | ||
| internal void PoisonMessageDetected(OrchestrationInstance orchestrationInstance, RequestMessage requestMessage, string details) | ||
| { | ||
| if (this.IsStructuredLoggingEnabled) | ||
| { | ||
| this.WriteStructuredLog(new LogEvents.PoisonMessageDetected( | ||
| orchestrationInstance, | ||
| requestMessage.IsLockRequest ? "LockRequest" : "OperationRequest", | ||
| requestMessage.Id.ToString(), | ||
| details)); | ||
| } | ||
| } | ||
| #endregion | ||
|
|
||
| internal void OrchestrationDebugTrace(string instanceId, string executionId, string details) | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I suggest we have these new properties be omitted by default if not populated, especially
IsPoisoned. This will reduce the chance that there's some compatibility issue with older versions of the SDK that try to deserialize the history.