-
Notifications
You must be signed in to change notification settings - Fork 805
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 slice reuse in cassandra/domain.go #5937
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files
... and 5 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
b318d8e
to
4fef375
Compare
@@ -410,6 +410,10 @@ func (db *cdb) SelectAllDomains( | |||
replicationClusters = []map[string]interface{}{} | |||
badBinariesData = []byte("") | |||
badBinariesDataEncoding = "" | |||
isolationGroups = []byte("") | |||
isolationGroupsEncoding = "" | |||
asyncWFConfigData = []byte("") |
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.
asyncWFConfigData = nil
would also do the job. not sure why the byte arrays were reset like this before.
While reading domains from Cassandra the isolationGroups and asncWFConfigData are not properly reset for each row. This can result in the same backing array being reused across multiple rows, resulting in an incorrect or corrupted value being read. Notably this is used for the domain cache, so any operation relying on it may be unable to get the correct values of these fields.
What changed?
Reset the fields for isolationGroups and asyncWFConfigData after each row.
While reading domains from Cassandra the isolationGroups and asncWFConfigData are not properly reset for each row. This can result in the same backing array being reused across multiple rows, resulting in an incorrect or corrupted value being read.
Why?
Fixes a bug where the domain cache contains the wrong async wf config data and is unable to trigger an async workflow despite it being enabled for that ddomain.
How did you test it?
Potential risks
Release notes
Documentation Changes