-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[improve][test] Use configured session timeout for MockZooKeeper and TestZKServer in PulsarTestContext #24171
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
Merged
lhotari
merged 2 commits into
apache:master
from
lhotari:lh-make-mockzookeeper-use-configured-session-timeout
Apr 11, 2025
Merged
[improve][test] Use configured session timeout for MockZooKeeper and TestZKServer in PulsarTestContext #24171
lhotari
merged 2 commits into
apache:master
from
lhotari:lh-make-mockzookeeper-use-configured-session-timeout
Apr 11, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…TestZKServer in PulsarTestContext
4 tasks
nodece
approved these changes
Apr 11, 2025
Member
nodece
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #24171 +/- ##
============================================
+ Coverage 73.57% 74.26% +0.69%
+ Complexity 32624 32074 -550
============================================
Files 1877 1864 -13
Lines 139502 144517 +5015
Branches 15299 16492 +1193
============================================
+ Hits 102638 107327 +4689
+ Misses 28908 28727 -181
- Partials 7956 8463 +507
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
poorbarcode
pushed a commit
to poorbarcode/pulsar
that referenced
this pull request
Apr 15, 2025
…TestZKServer in PulsarTestContext (apache#24171)
nodece
pushed a commit
to nodece/pulsar
that referenced
this pull request
Apr 22, 2025
…TestZKServer in PulsarTestContext (apache#24171) (cherry picked from commit 4c85b47)
ganesh-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
Apr 24, 2025
…TestZKServer in PulsarTestContext (apache#24171) (cherry picked from commit 4c85b47) (cherry picked from commit de4f06b)
ganesh-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
Apr 24, 2025
…TestZKServer in PulsarTestContext (apache#24171) (cherry picked from commit 4c85b47) (cherry picked from commit de4f06b)
manas-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
Apr 27, 2025
…TestZKServer in PulsarTestContext (apache#24171) (cherry picked from commit 4c85b47) (cherry picked from commit de4f06b)
ganesh-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
Apr 30, 2025
…TestZKServer in PulsarTestContext (apache#24171) (cherry picked from commit 4c85b47) (cherry picked from commit de4f06b)
manas-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
May 2, 2025
…TestZKServer in PulsarTestContext (apache#24171) (cherry picked from commit 4c85b47) (cherry picked from commit de4f06b)
manas-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
May 2, 2025
…TestZKServer in PulsarTestContext (apache#24171) (cherry picked from commit 4c85b47) (cherry picked from commit eb7ba99)
srinath-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
May 6, 2025
…TestZKServer in PulsarTestContext (apache#24171) (cherry picked from commit 4c85b47) (cherry picked from commit eb7ba99)
This was referenced Aug 27, 2025
walkinggo
pushed a commit
to walkinggo/pulsar
that referenced
this pull request
Oct 8, 2025
…TestZKServer in PulsarTestContext (apache#24171)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/test
cherry-picked/branch-3.0
cherry-picked/branch-3.3
cherry-picked/branch-4.0
doc-not-needed
Your PR changes do not impact docs
ready-to-test
release/3.0.12
release/3.3.7
release/4.0.5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
After #23988, MockZooKeeper is correctly single threaded and an injected delay will block the execution of this code in ZKSessionWatcher:
pulsar/pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/ZKSessionWatcher.java
Lines 108 to 115 in 6e8c349
This will trigger a ConnectionLost session event. That's why a delay should be kept under 2000 ms.
Currently MockZooKeeper's session timeout is hard coded to 30000ms and the check interval is 1/15 of this, therefore 2000ms.
When there's a test that blocks the ZooKeeper thread for more than 2000ms, it will result in a ConnectionLost event.
This PR makes the session timeout configurable and it's possible to increase the session timeout for tests where it's necessary to use a longer session timeout to avoid ConnectionLost session events.
Modifications
MetadataStoreConfigsettings and pass them from theServiceConfigurationinstanceDocumentation
docdoc-requireddoc-not-neededdoc-complete