On Mon, Jul 10, 2023 at 01:44:45PM +0900, Michael Paquier wrote:
> As StreamLogicalLog() states once it leaves its main loop because
> time_to_abort has been switched to true, we want a clean exit. I
> think that this patch is just a more complicated way to avoid doing
> twice the operations done by prepareToTerminate(). So how about
> moving the prepareToTerminate() call outside the main streaming loop
> and call it when time_to_abort is true? Then, I would suggest to
> change the keepalive argument of prepareToTerminate() to an enum able
> to handle three values to log the reason why the tool is stopping: the
> end of WAL, an interruption or a keepalive when logging. There are
> two of them now, but we want a third mode for the signals.
It took me some time to come back to this one, but attached is what I
had in mind. This stuff has three reasons to stop: keepalive, end LSN
or signal. This makes the code easier to follow.
Thoughts or comments?
--
Michael