Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up onReconnect after initial sub on the connection to log-reader.
If we set it up before `subscribeAndWait` returns, then we'll end up with two subscriptions; we don't have the log-reader sub yet, so we can't stop it when `onReconnect` runs the first time, so we end up with a redundant subscription. This means that if a real reconnect happens later, we'll stop the sub that we set up inside `onReconnect`, but not the initial sub, so we've leaked a sub and end up with duplicate messages after reconnect.
- Loading branch information