Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: doesn't beaks on big batches to write #1483

Open
rekby opened this issue Sep 25, 2024 · 3 comments
Open

feat: doesn't beaks on big batches to write #1483

rekby opened this issue Sep 25, 2024 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers topic issue for topic service

Comments

@rekby
Copy link
Member

rekby commented Sep 25, 2024

Now the topic.Write will be failed if try to send more messages, than internal buffer has limit.

It isn't comfortable and it isn't purpose of the queue limit.
Better choise:

  1. Acquire max limit and member overdraft

    if semaphoreWeight > int64(w.cfg.MaxQueueLen) {

  2. When release semaphore - first debt override.
    2.1. Here (if weight more then zero)

    w.semaphore.Release(semaphoreWeight)

    2.2. Here

It will allow send big batches without errors and will protect from memory overflow on network/server problems.

@rekby rekby added enhancement New feature or request good first issue Good for newcomers topic issue for topic service labels Sep 25, 2024
@rekby rekby changed the title feat: doesn't beaks on override limits feat: doesn't beaks on big batches to write Sep 25, 2024
@matvey22122
Copy link

Hi! May I take this task?

@rekby
Copy link
Member Author

rekby commented Sep 25, 2024

Yes, ofcourse

@matvey22122
Copy link

Can you put me in context in a nutshell? What is the core behavior contained within topic, and topic.Write?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers topic issue for topic service
Projects
None yet
Development

No branches or pull requests

2 participants