-
Notifications
You must be signed in to change notification settings - Fork 559
Open
Description
We set AutoReconnect to false in our ClientOptions. When the connection to the broker is lost unexpectedly, we see the following error come from this library:
[client] BUG BUG BUG reconnection function is nil
Tracing through the code, this is because disDone is assigned like so.
Line 517 in 714f7c0
| disDone, err := c.status.ConnectionLost(c.options.AutoReconnect && c.status.ConnectionStatus() > connecting) |
Since c.options.AutoReconnect is false, that will pass false to c.status.ConnectionLost. Thus the callback that it returns will itself return nil, nil.
Lines 278 to 280 in 714f7c0
| if !reconnectRequested || !proceed { | |
| return nil, nil | |
| } |
This in turn triggers the log that "should never happen".
Lines 547 to 552 in 714f7c0
| reConnDone, err := disDone(true) | |
| if err != nil { | |
| ERROR.Println(CLI, "failure whilst reporting completion of disconnect", err) | |
| } else if reConnDone == nil { // Should never happen | |
| ERROR.Println(CLI, "BUG BUG BUG reconnection function is nil", err) | |
| } |
I believe this regression was introduced in v1.4.2. It prevents us from upgrading from v1.3.5.
Cyrannosaurus and cserrander
Metadata
Metadata
Assignees
Labels
No labels