Skip to content

router.NewConsistentHashPool has error occurred while closing #1142

@remainbeen

Description

@remainbeen

Describe the bug
I used router.NewConsistentHashPool to create a pool in cluster. Then when I closed the program, I got an error:
`7:46PM INF [ACTOR] Recovering lib=Proto.Actor system=fBr5nhw5vuR79aeLVBJe3V self="Address:"127.0.0.1:64236" Id:"partition-activator"" reason="runtime error: invalid memory address or nil pointer dereference"
debug.Stack(): goroutine 27 [running]:
runtime/debug.Stack()
C:/Program Files/Go/src/runtime/debug/stack.go:26 +0x5e
github.com/asynkron/protoactor-go/actor.(*actorContext).EscalateFailure(0xc000200900, {0x11ada40, 0x18d9d60}, {0x1236760, 0xc0006b2500})
D:/Study/protoactor-go/actor/actor_context.go:709 +0x19b
github.com/asynkron/protoactor-go/actor.(*defaultMailbox).run.func1()
D:/Study/protoactor-go/actor/mailbox.go:132 +0x58
panic({0x11ada40?, 0x18d9d60?})
C:/Program Files/Go/src/runtime/panic.go:785 +0x132
github.com/asynkron/protoactor-go/cluster/identitylookup/disthash.(*placementActor).onTerminated(0xc0002082d0, 0xc0006b2500)
D:/Study/protoactor-go/cluster/identitylookup/disthash/placement_actor.go:51 +0xe0
github.com/asynkron/protoactor-go/cluster/identitylookup/disthash.(*placementActor).Receive(0xc0002082d0, {0x13c86a8, 0xc000200900})
D:/Study/protoactor-go/cluster/identitylookup/disthash/placement_actor.go:39 +0x1fe
github.com/asynkron/protoactor-go/actor.(*actorContext).defaultReceive(0xc000200900)
D:/Study/protoactor-go/actor/actor_context.go:372 +0x98
github.com/asynkron/protoactor-go/actor.(*actorContext).processMessage(0xc000200900, {0x1236760, 0xc0006b2500})
D:/Study/protoactor-go/actor/actor_context.go:527 +0xf9
github.com/asynkron/protoactor-go/actor.(*actorContext).InvokeUserMessage(0xc000200900, {0x1236760, 0xc0006b2500})
D:/Study/protoactor-go/actor/actor_context.go:505 +0x465
github.com/asynkron/protoactor-go/actor.(*actorContext).handleTerminated(0xc000200900, 0xc0006b2500?)
D:/Study/protoactor-go/actor/actor_context.go:628 +0x49
github.com/asynkron/protoactor-go/actor.(*actorContext).InvokeSystemMessage(0xc000200900?, {0x1236760?, 0xc0006b2500?})
D:/Study/protoactor-go/actor/actor_context.go:561 +0x15e
github.com/asynkron/protoactor-go/actor.(*defaultMailbox).run(0xc000200960)
D:/Study/protoactor-go/actor/mailbox.go:154 +0x1a6
github.com/asynkron/protoactor-go/actor.(*defaultMailbox).processMessages(0xc000200960)
D:/Study/protoactor-go/actor/mailbox.go:105 +0x25
created by github.com/asynkron/protoactor-go/actor.goroutineDispatcher.Schedule in goroutine 1
D:/Study/protoactor-go/actor/dispatcher.go:13 +0x16

[Supervision] Actor: Address:"127.0.0.1:64236" Id:"partition-activator" failed with message: who:{Address:"127.0.0.1:64236" Id:"partition-activator/test$d/router"} exception: runtime error: invalid memory address or nil pointer dereference`

To Reproduce
The test code is in the attachment。
1 build and run it.
2 press CTRL+C to close it.
You will see the error ocurred。

main.go.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions