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

Fix if the replication state is nil #3645

Merged
merged 1 commit into from
Oct 14, 2020
Merged

Fix if the replication state is nil #3645

merged 1 commit into from
Oct 14, 2020

Conversation

yux0
Copy link
Contributor

@yux0 yux0 commented Oct 14, 2020

What changed?
Fix if the replication state is nil

Why?
NPE

How did you test it?

Potential risks

@yux0 yux0 requested a review from mkolodezny October 14, 2020 00:29
@github-actions github-actions bot force-pushed the fix_replication_state branch from 741c0d7 to f0aa81f Compare October 14, 2020 00:30
@@ -1684,12 +1684,16 @@ func (d *cassandraPersistence) GetCurrentExecution(
currentRunID := result["current_run_id"].(gocql.UUID).String()
executionInfo := createWorkflowExecutionInfo(result["execution"].(map[string]interface{}))
replicationState := createReplicationState(result["replication_state"].(map[string]interface{}))
lastWriteVersion := common.EmptyVersion
if replicationState != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

was it not supposed to be nil at all times?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

With the current logic, we still write into replication state

Copy link
Contributor

@mkolodezny mkolodezny left a comment

Choose a reason for hiding this comment

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

Thanks for the quick fix!

@coveralls
Copy link

Coverage Status

Coverage increased (+0.06%) to 65.21% when pulling f0aa81f on fix_replication_state into 118ef83 on master.

@yux0 yux0 merged commit 1001823 into master Oct 14, 2020
@yux0 yux0 deleted the fix_replication_state branch October 14, 2020 01:36
yycptt pushed a commit that referenced this pull request Oct 15, 2020
github-actions bot pushed a commit to vytautas-karpavicius/cadence that referenced this pull request Feb 4, 2021
yux0 added a commit to yux0/cadence that referenced this pull request May 4, 2021
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.

3 participants