[crac] RFR: CRaC: Fix fds opened for logging [v2]

Radim Vansa rvansa at openjdk.org
Mon Oct 2 18:37:12 UTC 2023

On Mon, 2 Oct 2023 14:48:48 GMT, Jan Kratochvil <jkratochvil at openjdk.org> wrote:

>> OK, I have to improve it, thanks.
> I hope the stop() and resume() do fix it. But there is no testcase for that, do you want it?

I guess that a testcase for the synchronization would be quite difficult to do, as you'd be trying to simulate a race.

However, I am not convinced the `stop()` and `resume()` work correctly: the log writer does not need to own the lock while writing messages to the (potentially nulled) outputs; you flush the buffer and then acquire the lock, effectively blocking all log producers from enqueuing further messages. However if someone enqueues a message right after flush, the log writer has a chance to dequeue it (actually swap queues) and even if you acquire lock then, continue writing these messages to the closed output.


PR Review Comment: https://git.openjdk.org/crac/pull/113#discussion_r1343024529

More information about the crac-dev mailing list