Skip to content

Commit 76f8b70

Browse files
committed
fix usage internal codec
1 parent 6611c29 commit 76f8b70

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

tests/conftest.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,10 @@ async def topic_path(driver, topic_consumer, database) -> str:
142142
@pytest.fixture()
143143
@pytest.mark.asyncio()
144144
async def topic_with_messages(driver, topic_path):
145-
pass
146145
writer = driver.topic_client.topic_writer(
147146
topic_path, producer_and_message_group_id="fixture-producer-id"
148147
)
149-
await writer.write_with_ack(
148+
res = await writer.write_with_ack(
150149
ydb.TopicWriterMessage(data="123".encode()),
151150
ydb.TopicWriterMessage(data="456".encode()),
152151
)

ydb/_topic_writer/topic_writer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ def messages_to_proto_requests(
303303
req = StreamWriteMessage.FromClient(
304304
StreamWriteMessage.WriteRequest(
305305
messages=[msg.to_message_data()],
306-
codec=Codec.CODEC_RAW.value,
306+
codec=Codec.CODEC_RAW,
307307
)
308308
)
309309
res.append(req)

ydb/_topic_writer/topic_writer_asyncio.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,8 @@ async def _send_loop(self, writer: "WriterAsyncIOStream"):
363363
m = await self._new_messages.get() # type: InternalMessage
364364
if m.seq_no > last_seq_no:
365365
writer.write([m])
366+
except Exception as e:
367+
await self._stop(e)
366368
finally:
367369
pass
368370

0 commit comments

Comments
 (0)