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

BUG: Potential logical bug in file dapr/pkg/actors/actors.go #7380

Closed
fazledyn-or opened this issue Jan 15, 2024 · 0 comments · Fixed by #7381
Closed

BUG: Potential logical bug in file dapr/pkg/actors/actors.go #7380

fazledyn-or opened this issue Jan 15, 2024 · 0 comments · Fixed by #7381
Labels
kind/bug Something isn't working

Comments

@fazledyn-or
Copy link
Contributor

In what area(s)?

/area runtime

What version of Dapr?

Latest master branch

Expected Behavior

Not relevant. See description.

Actual Behavior

Not relevant. See description.

Description

While triaging your project, our bug fixing tool found a bug in file: actors.go. After inspecting the code, we found out that in the goroutine below, there are two send operations to channel errCh. One of these send operation is conditional (if the err value is not nil), and the other is normal.

go func(key any) {
    actorKey := key.(string)
    err := a.haltActor(a.getActorTypeAndIDFromKey(actorKey))
    if err != nil {
        errCh <- fmt.Errorf("failed to deactivate actor '%s': %v", actorKey, err)
    }
    errCh <- nil
}(key)

It looks like the channel is sent more values than it should. The correct condition should be as below-

if err != nil {
    errCh <- fmt.Errorf("failed to deactivate actor '%s': %v", actorKey, err)
} else {
    errCh <- nil
}

- From Dapr Discord Channel

Steps to Reproduce the Problem

Not relevant.

Fix

I'm going to create a PR to address and fix this bug.

Release Note

RELEASE NOTE: FIX Logical bug in runtime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant