Closed perbu closed 1 year ago
Even though I'm sending a few messages through, I still get some errors on Ctrl-C shutdown:
1:21PM INF apply raft log filter=testtopic/test from=testnode leader=testnode type=8
^C1:21PM WRN caught signal, stopping...
1:21PM INF stopping raft...
1:21PM ??? 2023-08-01T11:21:42.659+0200 [INFO] snapshot: creating new snapshot: path=data/testnode/snapshots/6-10-1690881702659.tmp
1:21PM ??? 2023-08-01T11:21:42.694+0200 [INFO] snapshot: reaping snapshot: path=data/testnode/snapshots/4-6-1690881574192
1:21PM ERR not graceful stop
Do you know what is causing the "not graceful stop"?
Okey, I think I got it.
In cluster/agent.go
, in the Stop() function there is a recover, which masks a panic. The shutdown tries to shutdown the GRPC service, which isn't defined, perhaps because it was never started.
The recover() masks the stacktrace. I have a fix for this, but I'm wondering if you agree that it is a good idea to remove the recover(). Perhaps it makes sense if there are other activities that must finish during shutdown, but otherwise I think it is a bad practice to mask panics.
Let me know and I'll have a PR for you.
ok, you try to fix it.
Hi there Wind.
Excellent work on the tests. 🥇 I'm very happy about this. We're 99% of the way.
I struggle a bit with that leak test I did. So what I do is run a cluster node with the following arguments:
-node-name testnode -members localhost:7946 -raft-bootstrap true -storage-way memory
This runs cleanly, but if I shut it down (Ctrl-C), the following happens:
I suspect this causes the leaktest, which basically does this, does not to complete correctly, leaving a couple of goroutines hanging. Is the error "nothing new to snapshot" - really an error?
All the best, Per.