Skip to content

feat(sdk): add replay-aware logging to suppress logs during execution replay#88

Closed
rarepolz wants to merge 1 commit intomainfrom
log-replay
Closed

feat(sdk): add replay-aware logging to suppress logs during execution replay#88
rarepolz wants to merge 1 commit intomainfrom
log-replay

Conversation

@rarepolz
Copy link
Contributor

Issue #, if available:
closes #50
Description of changes:

  • Track visited operations in DurableContext logger
  • Suppress default logger output when replaying existing operations
  • Add ReplayAwareLogger class for custom replay behavior
  • Provide is_replay() method to check current execution state
  • Ignore EXECUTION type operations in replay detection

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

- Track visited operations in DurableContext logger
- Suppress default logger output when replaying existing operations
- Add ReplayAwareLogger class for custom replay behavior
- Provide is_replay() method to check current execution state
- Ignore EXECUTION type operations in replay detection
@rarepolz rarepolz changed the title feat: add replay-aware logging to suppress logs during execution replay feat(sdk): add replay-aware logging to suppress logs during execution replay Oct 23, 2025
@rarepolz rarepolz marked this pull request as ready for review October 23, 2025 14:57
@rarepolz rarepolz requested review from a user, bchampp and yaythomas October 23, 2025 14:57
Comment on lines +104 to +111
# Check if there are any operations in the execution state that we haven't visited
# Only consider operations that are not EXECUTION type (which are system operations)
for operation_id, operation in self._execution_state.operations.items():
# Skip EXECUTION operations as they are system operations, not user operations
if operation.operation_type == OperationType.EXECUTION:
continue
if operation_id not in self._visited_operations:
return True
Copy link

Choose a reason for hiding this comment

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

We can be in replay and still not visit every operation, e.g. we have a parallel with 5 child executions that has completed due to minSuccessful == 1, then on replay, the optimized replay will only visit the completed thread.

@ghost
Copy link

ghost commented Oct 29, 2025

I am not sure about this implementation, we can visit a state twice, and one time the state is STARTED and the next is FAILED, if we only consider the operation ID, then we are missing out on transitions.

@leandrodamascena
Copy link
Contributor

leandrodamascena commented Nov 24, 2025

Should we close this PR @PartiallyUntyped @yaythomas ?

#197

@ghost
Copy link

ghost commented Nov 24, 2025

Yeah let's do that.

@ghost ghost closed this Nov 24, 2025
@leandrodamascena leandrodamascena mentioned this pull request Nov 28, 2025
2 tasks
@wangyb-A wangyb-A deleted the log-replay branch December 9, 2025 22:31
This pull request was closed.
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.

Don't log on replay

2 participants