RFR: 8352568: Test gtest/AsyncLogGtest.java failed at droppingMessage_vm

Johan Sjölen jsjolen at openjdk.org
Fri Apr 11 08:18:26 UTC 2025


On Thu, 10 Apr 2025 07:25:01 GMT, David Holmes <dholmes at openjdk.org> wrote:

> Can you elaborate on what the issue with BufferUpdater was. I admit I'm not clear what it was doing.

The `BufferUpdater` swaps the pointers `Buffer* _buffer` and `Buffer* _buffer_staging` to new `Buffer` objects while holding a lock, but this lock isn't held by the async log writer when reading `_buffer_staging` for writing. This leads to a data race, which is probably the source of this bug. That this race manifests as a bug now is probably just an accident, there's been changes to this code so the timings are different, I guess.

`BufferUpdater` is only used for tests and only to make the `Buffer`s very small, so that we only have to write 1KiB of data to a file in order to detect dropped messages occurring. Now we need to write 100KiB, which I think is acceptable.

Since `BufferUpdater` is only being used for tests, I felt it was easiest just to get rid of the `BufferUpdater` without figuring out exactly what happens during the data race which in turn manifests as this bug.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/24508#issuecomment-2796179191


More information about the hotspot-runtime-dev mailing list