Skip to content

refactor(topic): make writer state and task ownership explicit - #628

Open
aral01 wants to merge 4 commits into
graceful-session-pool-shutdown-cleanfrom
refactor/topic-writer-runtime
Open

refactor(topic): make writer state and task ownership explicit#628
aral01 wants to merge 4 commits into
graceful-session-pool-shutdown-cleanfrom
refactor/topic-writer-runtime

Conversation

@aral01

@aral01 aral01 commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

  • Logical state is distributed across the queue, reconnector status watch channel, fatal-error channel, current stream writer, and reconnect state machine.
  • Queue uses tokio::sync::Mutex, although only sync work is done under mutex.
  • Reconnector manually implements retry machinery across multiple state-machine functions.
  • Connection task ownership and failure handling are distributed across several abstractions.

Issue Number: related #600

What is the new behavior?

  • Shared logical writer state is consolidated in WriterState
  • Each connection is represented by five fail-only background jobs stored in JoinSet<YdbResult>.
  • Reconnector becomes straight loop: acquire initial StreamWriter, watch all spawned tasks, on fail: cancel others, in retry loop spawn new tasks. State machine and helpers are deleted.
  • The standard RetrySettings API is used to retry all operations

Other information

@aral01
aral01 force-pushed the refactor/topic-writer-runtime branch from b36c5d4 to 814137a Compare August 19, 2026 18:37
@aral01
aral01 force-pushed the refactor/topic-writer-runtime branch from 814137a to 39d248b Compare August 24, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant