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

GH-1296: Fix DMLC Recovery: Missing Queue at Start #1297

Merged
merged 1 commit into from Jan 12, 2021

Conversation

garyrussell
Copy link
Contributor

Resolves #1296

  • Add MissingQueueEvent
  • Fix detection of a deleted queue in recovery - previously incorrectly used the
    absense of the queue in consumersByQueue, which can be empty if missing during
    start
  • Add an index to SimpleConsumer
  • When adjusting consumer counts, look for gaps in the index sequence because reducing
    the consumer count can remove any idle consumer.
  • Change consumers to restart to a Set to avoid OOM when no broker
    (see Fix possible memory leak during DirectMessageListenerContainer startup #642)
  • Unconditionally add consumers to consumersToRestart

cherry-pick to 2.2.x, 2.1.x

Resolves spring-projects#1296

- Add `MissingQueueEvent`
- Fix detection of a deleted queue in recovery - previously incorrectly used the
  absense of the queue in `consumersByQueue`, which can be empty if missing during
  start
- Add an index to `SimpleConsumer`
- When adjusting consumer counts, look for gaps in the index sequence because reducing
  the consumer count can remove any idle consumer.
- Change consumers to restart to a `Set` to avoid OOM when no broker
  (see spring-projects#642)
- Unconditionally add consumers to `consumersToRestart`

**cherry-pick to 2.2.x, 2.1.x**
Copy link
Member

@artembilan artembilan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So smart!

I also thought about moving to Set for consumers to avoid OOM, but then it was a problem for me to figure out how to make them unique.
The index is a good solution although it is hard to digest it at a glance why would one be so strict trying to fill the gaps 😄

I mean we just could use unique ids for consumers to reuse them on restart.
However I find your solution less stressful than those UUIDs.

@artembilan artembilan merged commit 2c929ff into spring-projects:master Jan 12, 2021
@artembilan
Copy link
Member

Cherry-picked to 2.2.x as b52a549 after fixing conflicts.

To 2.1.x as 69ec278 after more conflicts fixing.

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.

Starting DirectMessageListenerContainer does not addConsumerToRestart when consumer failed to start
2 participants