-
Notifications
You must be signed in to change notification settings - Fork 10
feat: Use per-context replay status #403
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,8 +15,6 @@ public abstract class BaseContextImpl implements AutoCloseable, BaseContext { | |
| private final String contextName; | ||
| private final ThreadType threadType; | ||
|
|
||
| private boolean isReplaying; | ||
|
|
||
| /** | ||
| * Creates a new BaseContext instance. | ||
| * | ||
|
|
@@ -39,7 +37,6 @@ protected BaseContextImpl( | |
| this.lambdaContext = lambdaContext; | ||
| this.contextId = contextId; | ||
| this.contextName = contextName; | ||
| this.isReplaying = executionManager.hasOperationsForContext(contextId); | ||
| this.threadType = threadType; | ||
| } | ||
|
|
||
|
|
@@ -97,16 +94,12 @@ public ExecutionManager getExecutionManager() { | |
| return executionManager; | ||
| } | ||
|
|
||
| /** Returns whether this context is currently in replay mode. */ | ||
| @Override | ||
| public boolean isReplaying() { | ||
| return isReplaying; | ||
| } | ||
|
|
||
| /** | ||
| * Transitions this context from replay to execution mode. Called when the first un-cached operation is encountered. | ||
| * Returns whether this context is currently in replay mode. The default implementation returns false. Subclasses | ||
| * that track per-context replay status (like DurableContextImpl) override this. | ||
| */ | ||
| public void setExecutionMode() { | ||
| this.isReplaying = false; | ||
| @Override | ||
| public boolean isReplayingContext() { | ||
| return false; | ||
|
Contributor
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. is this intended?
Contributor
Author
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. Yes, intentional. The default returns false (don't suppress) which is the safe default. Only DurableContextImpl overrides it with actual replay tracking. The only other subclass is StepContextImpl, whose user function only runs during real execution - so its logs should never be suppressed. |
||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
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.
removing an existing method would be a breaking change. We'll need a major version upgrade if we really want to remove 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.
Can mark it as deprecated and remove in future.