From f333cb1a72974e63ef7d6028749b214b4bee43f2 Mon Sep 17 00:00:00 2001 From: Radek Stankiewicz Date: Thu, 23 Jul 2026 15:38:53 +0200 Subject: [PATCH] Fix ThreadSanitizer data races between bundle processing and async background writer closing in FileBasedSink and WriteFiles --- .../main/java/org/apache/beam/sdk/io/FileBasedSink.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileBasedSink.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileBasedSink.java index bba9b1f82f5b..a8d7fd8fcb24 100644 --- a/sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileBasedSink.java +++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileBasedSink.java @@ -905,15 +905,15 @@ public abstract static class Writer { private final WriteOperation writeOperation; /** Unique id for this output bundle. */ - private @Nullable String id; + private volatile @Nullable String id; - private @Nullable DestinationT destination; + private volatile @Nullable DestinationT destination; /** The output file for this bundle. May be null if opening failed. */ - private @Nullable ResourceId outputFile; + private volatile @Nullable ResourceId outputFile; /** The channel to write to. */ - private @Nullable WritableByteChannel channel; + private volatile @Nullable WritableByteChannel channel; /** * The MIME type used in the creation of the output channel (if the file system supports it).