Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces configurable backpressure for the Topic Writer by adding a byte-size limit for the internal in-flight buffer and making writes block (up to a timeout) until space is freed by server acks.
Changes:
- Add
max_buffer_size_bytesandbuffer_wait_timeout_secto writer settings and enforce them inWriterAsyncIOReconnector.write_with_ack_future(). - Add a new public exception
TopicWriterBufferFullErrorsurfaced viaydb.topic. - Add sync/async tests and an example showing how to use the buffer limit.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
ydb/topic.py |
Exports the new TopicWriterBufferFullError as part of the public Topic API. |
ydb/_topic_writer/topic_writer.py |
Adds settings fields, new exception type, and a helper for message size accounting. |
ydb/_topic_writer/topic_writer_asyncio.py |
Implements buffer accounting + backpressure wait loop and updates ack handling/shutdown behavior. |
ydb/_topic_writer/topic_writer_test.py |
Adds sync writer tests around error propagation/blocking behavior. |
ydb/_topic_writer/topic_writer_asyncio_test.py |
Adds async tests for timeout, ack-unblocking, and concurrent waiting writers. |
examples/topic/writer_example.py |
Documents how to configure and handle backpressure in user code. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6e60736 to
b52cbb3
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b52cbb3 to
3cea8bd
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
faf5242 to
25f24bc
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c242e73 to
875c541
Compare
875c541 to
c5cea59
Compare
Pull request type
Please check the type of change your PR introduces:
What is the current behavior?
Fixes: #694
Fixes: #137
Fixes: #136
What is the new behavior?
Other information