$ the-wire · showcase
AMQP channel exhaustion and frame_max fixes, security race condition closed
By RepoJournal · Filed · About Spring
Spring AMQP shipped fixes for two channel-leak and header-loss bugs, Spring Security closed a HeaderWriterFilter race condition, and Spring Kafka honors shared-container client IDs.
Spring AMQP [1] now closes the captured publisher channel when waitForConfirms() fails with exceptions other than ShutdownSignalException or TimeoutException. Previously those channels were never closed, leaking ChannelN instances when checkoutTimeout is 0 and blocking publishing after reconnect. Update before any deploy using waitForConfirms with a zero checkoutTimeout.
Spring AMQP [2] also fixes RepublishMessageRecoverer when frame_max is unknown. includeStackTrace(true) stored -1 to mean "resolve the limit from frame_max", but when frame_max couldn't be determined, processStackTrace() left that -1 in place and recover() then dropped the x-exception-stacktrace header the caller had opted into. The header is now emitted as requested even when frame_max is unknown. In AMQP 1.0, doPause() used to write flow directly from whatever thread invoked pause(), racing a single mutable ProtonSession instance shared by all links; it now writes on the session thread.
Spring Security [3] fixed a race condition in HeaderWriterFilter, closing gh-9175. Also, BearerTokenAuthentication now compares OAuth2AccessToken.TokenType with equals() instead of ==, because "TokenType instances are not guaranteed to be singletons and reference comparison can incorrectly reject an otherwise-equal bearer token." [4]
Spring Kafka [5] now honors the container properties client id in share containers. determineClientId previously ignored the value ShareKafkaListenerContainerFactory copies from clientIdPrefix into container properties, plus any factory-level client id, so the consumer fell back to the bean name.
Action items
- → Upgrade spring-amqp for the confirm-wait channel leak fix before deploying with waitForConfirms and checkoutTimeout 0 spring-projects/spring-amqp [immediate]
- → Upgrade spring-amqp to get RepublishMessageRecoverer to include x-exception-stacktrace when frame_max is unknown spring-projects/spring-amqp [immediate]
- → Upgrade spring-security for the HeaderWriterFilter race condition fix spring-projects/spring-security [plan]
- → Upgrade spring-kafka for correct client IDs in share containers spring-projects/spring-kafka [plan]
References
- [1] GH-3448: Close channels if confirm wait fails ↗ spring-projects/spring-amqp
- [2] GH-3616: Fix `RepublishMessageRecoverer` when `frame_max` is unknown ↗ spring-projects/spring-amqp
- [3] Fix HeaderWriterFilter Race Condition ↗ spring-projects/spring-security
- [4] Fix TokenType Comparison Logic ↗ spring-projects/spring-security
- [5] GH-4601: Honor the container properties client id in share containers (#4602) ↗ spring-projects/spring-kafka