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

[bugfix] Integrate improved three-point lock for capture routines and improve concurrency patterns #318

Merged

Conversation

fako1024
Copy link
Collaborator

First attempt at fixing (or at least improving) the potential deadlocks. I still wasn't able to reproduce the issue to its full extend, but at least one of the observed crashes I confirmed to be addressed by this. The issue will remain open after merging this for further assessment.

@fako1024 fako1024 added bug Something isn't working critical Issues that should be looked at with priority labels May 23, 2024
@fako1024 fako1024 requested a review from els0r May 23, 2024 10:52
@fako1024 fako1024 self-assigned this May 23, 2024
@fako1024 fako1024 linked an issue May 23, 2024 that may be closed by this pull request
3 tasks
Copy link
Owner

@els0r els0r left a comment

Choose a reason for hiding this comment

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

The usual mimi. Otherwise: good to go!

pkg/capture/capture.go Outdated Show resolved Hide resolved
pkg/capture/capture.go Show resolved Hide resolved
status, err := mc.status()
if lErr := mc.capLock.Unlock(); lErr != nil {
logger := logging.FromContext(runCtx)
logger.Errorf("failed to release status call three-point lock: %s", err)
Copy link
Owner

Choose a reason for hiding this comment

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

Nitpick: this is copy-pasta. Put into err messages.

logger := logging.FromContext(runCtx)
logger.Errorf("failed to release status call three-point lock: %s", err)
if err := mc.close(); err != nil {
logger.Errorf("failed to close capture after failed three-point lock: %s", err)
Copy link
Owner

Choose a reason for hiding this comment

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

same here

@@ -62,6 +63,51 @@ func (t testMockSrcs) Wait() error {
return nil
}

// func TestInterfaceChanges(t *testing.T) {
Copy link
Owner

Choose a reason for hiding this comment

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

Out with it? Or do you still need it?

@fako1024 fako1024 merged commit 220343f into main May 23, 2024
5 checks passed
@fako1024 fako1024 deleted the 317-deadlock-in-three-point-capture-routine-lock-sporadic branch May 23, 2024 13:57
@fako1024 fako1024 restored the 317-deadlock-in-three-point-capture-routine-lock-sporadic branch June 11, 2024 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working critical Issues that should be looked at with priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deadlock in three-point capture routine lock (sporadic)
2 participants