Skip to content

Commit c806cb1

Browse files
qyryqGazizonoki
authored andcommitted
Topic SDK: change type of ServerBytesSize to atomic (#24252)
1 parent 17685f9 commit c806cb1

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

.github/last_commit.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2663e554d10f2d617bf96acaa684868685f3a8d7
1+
66e1273f270f166cf9a11288b0b2310f55e6de82

src/client/topic/impl/read_session_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ class TDataDecompressionInfo : public std::enable_shared_from_this<TDataDecompre
365365
std::vector<TMessageMetaPtrVector> MessagesMeta;
366366
TCallbackContextPtr<UseMigrationProtocol> CbContext;
367367
bool DoDecompress;
368-
i64 ServerBytesSize = 0;
368+
std::atomic<i64> ServerBytesSize = 0;
369369
std::atomic<i64> SourceDataNotProcessed = 0;
370370
std::pair<size_t, size_t> CurrentDecompressingMessage = {0, 0}; // (Batch, Message)
371371
std::deque<TReadyMessageThreshold> ReadyThresholds;

src/client/topic/impl/read_session_impl.ipp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <util/generic/yexception.h>
2525
#include <util/stream/mem.h>
2626

27+
#include <atomic>
2728
#include <utility>
2829
#include <variant>
2930

@@ -2984,7 +2985,7 @@ void TDataDecompressionInfo<UseMigrationProtocol>::OnDataDecompressed(i64 source
29842985
if (auto session = CbContext->LockShared()) {
29852986
// TODO (ildar-khisam@): distribute total ServerBytesSize in proportion of source size
29862987
// Use CompressedDataSize, sourceSize, ServerBytesSize
2987-
session->OnDataDecompressed(sourceSize, estimatedDecompressedSize, decompressedSize, messagesCount, std::exchange(ServerBytesSize, 0));
2988+
session->OnDataDecompressed(sourceSize, estimatedDecompressedSize, decompressedSize, messagesCount, ServerBytesSize.exchange(0));
29882989
}
29892990
}
29902991

0 commit comments

Comments
 (0)