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 spurious nil derefs on retrying local activities #303

Merged
merged 6 commits into from
Dec 17, 2020

Conversation

Sushisource
Copy link
Member

@Sushisource Sushisource commented Dec 4, 2020

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.

@Sushisource Sushisource marked this pull request as draft December 4, 2020 22:52
@Sushisource Sushisource force-pushed the fix-la-retry-nil-panic branch from 931eb98 to bfb5695 Compare December 11, 2020 21:48
@Sushisource Sushisource marked this pull request as ready for review December 11, 2020 21:49
Comment on lines -497 to +499
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)
Copy link
Contributor

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?

Copy link
Contributor

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

Copy link
Member Author

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.

@Sushisource Sushisource requested a review from vitarb December 14, 2020 21:51
@vitarb vitarb self-requested a review December 16, 2020 06:17
@Sushisource Sushisource merged commit 2c8dc43 into temporalio:master Dec 17, 2020
@Sushisource Sushisource deleted the fix-la-retry-nil-panic branch December 17, 2020 22:42
muralisrini pushed a commit to muralisrini/sdk-go that referenced this pull request Feb 4, 2024
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