lni / dragonboat

A feature complete and high performance multi-group Raft library in Go.
Apache License 2.0
5.09k stars 542 forks source link

[BUG FIX] fixes panic recovery in nodehost.NewNodeHost #374

Open tephrocactus opened 1 month ago

tephrocactus commented 1 month ago

Function NewNodeHost (nodehost:339)

When panic happens it's message is type-asserted as error, but often panic() is called with just a string. As a result panic is silently recovered without calling panicNow() and nil NodeHost instance is returned without any error. It is now fixed.

grobza commented 1 month ago

if you add a default it would be a general fix