Fix nil pointer during SearchAttribute translation#102
Merged
pglass merged 3 commits intoscaleai/patchfrom Jun 25, 2025
Merged
Conversation
hehaifengcn
reviewed
Jun 24, 2025
Collaborator
hehaifengcn
left a comment
There was a problem hiding this comment.
we can just check it into main branch
hehaifengcn
reviewed
Jun 24, 2025
| containsObj: false, | ||
| makeType: func(name string) any { | ||
| return &persistence.WorkflowExecutionInfo{ | ||
| SearchAttributes: nil, |
Collaborator
There was a problem hiding this comment.
curious how the translation work in this case.
Contributor
Author
There was a problem hiding this comment.
If we see SearchAttributes = nil, we should just ignore it. (It would mean this wf has no custom search attributes, so no translation needed)
hehaifengcn
approved these changes
Jun 24, 2025
added 2 commits
June 24, 2025 19:48
hehaifengcn
pushed a commit
that referenced
this pull request
Jun 25, 2025
temporal-nick
pushed a commit
that referenced
this pull request
Jun 25, 2025
* Fix nil pointer during SearchAttribute translation (#102) * Continue clientLoop even client failed to dial with retry and add more logs (#103) * Add more logging and enable debug * disable debug log * dial fail log * Continue clientLoop even client failed to dial with retry --------- Co-authored-by: Paul Glass <pnglass@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was changed
Avoid a nil pointer during search attribute translation.
This wasn't caught by existing tests because the
visitlibrary we use for reflection maintains a seen set based on pointer addresses. If a type contains two fields that are both pointer types, and both fields are nil, then it will only visit the first nil field. The next time it encounters a nil field,nilis already marked as a seen address and it skips that field without visiting it.Why?
Checklist
Closes
How was this tested: