Skip to content

Fix flaky reactorNettyAttributes test by using doFinally for synchronous cleanup#36592

Open
Pratapchandradeo wants to merge 1 commit intospring-projects:mainfrom
Pratapchandradeo:fix/gh-36589-reactor-netty-attributes
Open

Fix flaky reactorNettyAttributes test by using doFinally for synchronous cleanup#36592
Pratapchandradeo wants to merge 1 commit intospring-projects:mainfrom
Pratapchandradeo:fix/gh-36589-reactor-netty-attributes

Conversation

@Pratapchandradeo
Copy link
Copy Markdown

Use doFinally operator in the reactive chain for guaranteed synchronous cleanup:

  • Store Connection in AtomicReference
  • Use doFinally(signal -> clearChannelAttribute(conn)) instead of async callback
  • Ensures cleanup is part of reactive chain
  • Remove @Disabled annotation from test

Changes

  • ReactorClientHttpConnector.java: Add connectionRef, doFinally operator, clearChannelAttribute() method
  • WebClientIntegrationTests.java: Remove @Disabled annotation

Fixes #36589
Relates to #36158

Signed-off-by: Pratap Chandra Deo pratapchandradeo@users.noreply.github.com

…hronous cleanup


- Use doFinally operator to guarantee channel attribute cleanup
- Store Connection reference in AtomicReference for access in doFinally
- Remove @disabled annotation from reactorNettyAttributes test
- This fixes spring-projectsgh-36589 which was caused by async cleanup race condition
- Follows reactive best practices using operator-level cleanup

Fixes spring-projects#36589
Relates to spring-projects#36158
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged or decided on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Determine why reactorNettyAttributes() in WebClientIntegrationTests is flaky

2 participants