Skip to content

[fix][client] Fix idle connection release ignoring V5 watch sessions#25697

Merged
lhotari merged 1 commit intoapache:masterfrom
Dream95:fix_idleCheck
May 6, 2026
Merged

[fix][client] Fix idle connection release ignoring V5 watch sessions#25697
lhotari merged 1 commit intoapache:masterfrom
Dream95:fix_idleCheck

Conversation

@Dream95
Copy link
Copy Markdown
Contributor

@Dream95 Dream95 commented May 6, 2026

Motivation

When connectionMaxIdleSeconds is enabled, ConnectionPool periodically calls ClientCnxIdleState#doIdleDetect, which uses ClientCnx#idleCheck() to decide whether a pooled connection is idle. idleCheck() did not account for V5 registrations (dagWatchSessions, scalableConsumerSessions, scalableTopicsWatchers), while channelInactive treats them as live sessions on the connection. As a result, connections that still served scalable-topic watches or DAG watches could be marked idle and released, causing unnecessary disconnects and other errors.

Modifications

Added checks in ClientCnx#idleCheck() for dagWatchSessions, scalableConsumerSessions, and scalableTopicsWatchers

Verifying this change

  • Make sure that the change passes the CI checks.

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Matching PR in forked repository

PR in forked repository: Dream95#7

Copy link
Copy Markdown
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

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

LGTM, thank you @Dream95

@lhotari lhotari added this to the 5.0.0-M1 milestone May 6, 2026
@Dream95
Copy link
Copy Markdown
Contributor Author

Dream95 commented May 6, 2026

/pulsarbot rerun-failure-checks

@lhotari lhotari merged commit 0a6b6f9 into apache:master May 6, 2026
81 of 83 checks passed
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.

2 participants