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

panic fix: no version histories is mutable state #6589

Merged

Conversation

dkrotx
Copy link
Member

@dkrotx dkrotx commented Jan 3, 2025

What changed?
Not panicing on GetMutableState and no version histories

Why?
Having no version histories is considered OK by getMutableState which
has:

if versionHistories != nil {
        retResp.VersionHistories = versionHistories.ToInternalType()
}

Which means, PollMutableState/GetMutableState should not panic on this.
It is now returning error instead.
Looks like we're dealing with corrupted workflows (left a corresponding
comment).

How did you test it?
A new unit-test

Potential risks
Change should be transparent as the corruption error should always be expected.

Release notes

Documentation Changes

Having no version histories is considered OK by `getMutableState` which
has:
```
if versionHistories != nil {
        retResp.VersionHistories = versionHistories.ToInternalType()
}
```

Which means, PollMutableState/GetMutableState should not panic on this.
It is now returning error instead.
Looks like we're dealing with corrupted workflows (left a corresponding
comment).
Copy link
Contributor

@3vilhamster 3vilhamster left a comment

Choose a reason for hiding this comment

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

Looks good.

@dkrotx dkrotx merged commit c8eb964 into cadence-workflow:master Jan 3, 2025
17 checks passed
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