Closed krhubert closed 2 months ago
@krhubert based on the trace, I'm guessing you might be calling StopAndCancel
on a client which was never actually started? Obviously this shouldn't panic regardless, but I just want to confirm that's what's happening before attempting a fix.
A Client
only needs to be started if it is going to be working jobs (not just inserting them), and it only needs to be stopped if it has been started.
@bgentry I'm not sure if we talk about the same start.
In the code above there's a riverClient.Start
call.
Btw, this is a full source code that can be used to reproduce this panic.
Edited:
I haven't checked the error returned by Start :|
at least one Worker must be added to the Workers bundle
So you're right the client wasn't started at all.
What I did was - I checked if Stop
worked first and since the Stop
call did not panic nor return any error for not started client I assumed the problem was in the StartAndClose
Opened #557 to fix the problem of a panic in case of a call to StopAndCancel
before Start
.
I'm not sure why
client.StopAndCancel
panics whileclient.Stop
returns without any errorstacktrace
go.mod