-
Notifications
You must be signed in to change notification settings - Fork 217
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 spurious nil derefs on retrying local activities #303
Fix spurious nil derefs on retrying local activities #303
Conversation
931eb98
to
bfb5695
Compare
eventHandler := w.eventHandler.Load() | ||
if eventHandler == nil { | ||
if w.eventHandler == nil { | ||
return nil | ||
} | ||
eventHandlerImpl, ok := eventHandler.(*workflowExecutionEventHandlerImpl) | ||
if !ok { | ||
panic("unknown type for workflow execution event handler") | ||
} | ||
return eventHandlerImpl | ||
return (*w.eventHandler).(*workflowExecutionEventHandlerImpl) |
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.
do we need to grab a lock for 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.
since previously this is stored in atomic.Value
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.
Putting it here can cause deadlocks - generally functions calling into this one are doing the locking. Overall there's not much consistency around when the lock is taken. I'd be worth cleaning this up as part of the bigger refactorings I'll take on soon.
Add session failure sample
Depends on #302 being merged first
Relates to https://www.notion.so/Go-SDK-Nil-Reference-Panic-in-Bench-Test-b240b5f0db3b4d8088e3486939a53e78
It appears my fix in the MR this one depends on also fixes this item. I wasn't able to repro the issue after a variety of bench runs.Not quite. Will require a bit of extra fix.