Fix async writer - #151
Conversation
- revert commented implementation fromAbstractAppendOnlySynchronizedBucket.open_write
|
Caution Review failedThe pull request is closed. 📝 WalkthroughSummary by CodeRabbit
WalkthroughIntroduces a new cross-thread binary I/O module and rewires bucket write APIs to stream via an asynchronous writer using a background thread. Updates IBucket and synchronized wrappers to accept an optional timeout. Removes MinIO’s old queue-based writer. Adjusts FS/Memory buckets accordingly. Expands tests for streaming, timeouts, and queue utilities. Bumps version. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Caller
participant IBucket
participant AsyncWriter
participant Producer as QueueBinaryWritable
participant Consumer as QueueBinaryReadable
participant Bucket as BaseBucket
participant Storage as put_object_stream
Caller->>IBucket: open_write(name, timeout_sec)
IBucket-->>Caller: AsyncObjectWriter (context manager)
Caller->>AsyncWriter: __enter__()
AsyncWriter-->>Caller: BinaryIO (Producer)
AsyncWriter->>AsyncWriter: Start background Thread(_write_to_bucket)
par Producer writes
loop write()
Caller->>Producer: write(bytes)
Producer->>Consumer: feed(bytes, timeout)
end
Caller->>AsyncWriter: __exit__(exc?)
alt no exception
AsyncWriter->>Consumer: send_eof(timeout)
else exception in caller
AsyncWriter->>Consumer: send_exception_to_reader(exc)
end
and Background upload
AsyncWriter->>Bucket: put_object_stream(name, Consumer)
Bucket->>Storage: stream read() until EOF
alt upload success
Bucket-->>AsyncWriter: success
AsyncWriter->>Consumer: notify_upload_success()
else upload error
Bucket-->>AsyncWriter: error
AsyncWriter->>Consumer: on_consumer_fail(error)
end
end
AsyncWriter->>Consumer: wait_finish(timeout)
AsyncWriter-->>Caller: exit (propagate TimeoutError/chain errors if any)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (13)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
No description provided.