diff options
author | alexvru <alexvru@ydb.tech> | 2023-06-26 12:42:17 +0300 |
---|---|---|
committer | alexvru <alexvru@ydb.tech> | 2023-06-26 12:42:17 +0300 |
commit | 0cdd7c9ab8aefcf43da14a2cfb1512267692e3c7 (patch) | |
tree | 231387cabe07f0575f136601cb65698df116b4ac /library/cpp | |
parent | 264768d5c81a64d4c13d3028c07ea493bcb66bb3 (diff) | |
download | ydb-0cdd7c9ab8aefcf43da14a2cfb1512267692e3c7.tar.gz |
Fix coroutine event serializer
Diffstat (limited to 'library/cpp')
-rw-r--r-- | library/cpp/actors/core/event_pb.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/library/cpp/actors/core/event_pb.cpp b/library/cpp/actors/core/event_pb.cpp index 4c341d0c09..a2bf14aa02 100644 --- a/library/cpp/actors/core/event_pb.cpp +++ b/library/cpp/actors/core/event_pb.cpp @@ -63,6 +63,8 @@ namespace NActors { } bool TCoroutineChunkSerializer::WriteAliasedRaw(const void* data, int size) { + Y_VERIFY(!CancelFlag); + Y_VERIFY(!AbortFlag); Y_VERIFY(size >= 0); while (size) { if (const size_t bytesToAppend = Min<size_t>(size, SizeRemain)) { @@ -87,6 +89,8 @@ namespace NActors { } bool TCoroutineChunkSerializer::Next(void** data, int* size) { + Y_VERIFY(!CancelFlag); + Y_VERIFY(!AbortFlag); if (!SizeRemain) { InnerContext.SwitchTo(BufFeedContext); if (CancelFlag || AbortFlag) { @@ -170,7 +174,7 @@ namespace NActors { void TCoroutineChunkSerializer::DoRun() { while (!CancelFlag) { Y_VERIFY(Event); - SerializationSuccess = Event->SerializeToArcadiaStream(this); + SerializationSuccess = !AbortFlag && Event->SerializeToArcadiaStream(this); Event = nullptr; if (!CancelFlag) { // cancel flag may have been received during serialization InnerContext.SwitchTo(BufFeedContext); |