Skip to content

Conversation

garyrussell
Copy link
Contributor

Resolves #1866

The new retryable topic feature pauses/resumes individual partitions.

This broke normal container pause/resume by incorrectly resuming partitions
that were paused by the container pause operation.

Similarly, if individual partitions were paused and then the container was
paused and resumed, the container resumed all partitions.

Decouple the functionality to prevent this cross-talk.

Do not resume any individually paused partitions when the container is in a paused state.
Do not resume any individually paused partitions when the container is resumed.

Also

Use a ConcurrentHashMap.newKeySet() instead of synchronization on partition pause requests.
Use getAssignedPartitions() to allow the retry topic feature to work with manual assignments.

Add tests to verify no cross-talk between pausing individual partitions and the container.

Resolves spring-projects#1866

The new retryable topic feature pauses/resumes individual partitions.

This broke normal container pause/resume by incorrectly resuming partitions
that were paused by the container pause operation.

Similarly, if individual partitions were paused and then the container was
paused and resumed, the container resumed all partitions.

Decouple the functionality to prevent this cross-talk.

Do not resume any individually paused partitions when the container is in a paused state.
Do not resume any individually paused partitions when the container is resumed.

Also

Use a `ConcurrentHashMap.newKeySet()` instead of synchronization on partition pause requests.
Use `getAssignedPartitions()` to allow the retry topic feature to work with manual assignments.

Add tests to verify no cross-talk between pausing individual partitions and the container.
@garyrussell
Copy link
Contributor Author

cc/ @tomazfernandes @theogoria

@tomazfernandes
Copy link
Contributor

LGTM @garyrussell!

@artembilan artembilan merged commit ccb8b80 into spring-projects:main Jul 14, 2021
@artembilan
Copy link
Member

@garyrussell , let me know if we need to cherry-pick this to 2.7.x

@garyrussell
Copy link
Contributor Author

Yes, please; sorry - I keep forgetting main is now 2.8.x.

@garyrussell
Copy link
Contributor Author

It might not cherry-pick cleanly; If so, I can back port.

@garyrussell garyrussell deleted the GH-1866 branch July 14, 2021 16:48
@artembilan
Copy link
Member

Cherry-picked to 2.7.x as 726c485 after including the second race condition fix.

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.

Since version 2.7, paused consumer auto-resume without asking just after pausing.
3 participants