[Issue 1094][doc] Enhance ConnectionTimeout/KeepAliveInterval comments#1488
Open
geniusjoe wants to merge 1 commit intoapache:masterfrom
Open
[Issue 1094][doc] Enhance ConnectionTimeout/KeepAliveInterval comments#1488geniusjoe wants to merge 1 commit intoapache:masterfrom
geniusjoe wants to merge 1 commit intoapache:masterfrom
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #1094 and #1095
Motivation
In Issue #1094, the default value of
ConnectionTimeoutwas changed from10sto0(falling back to the OS kernel's TCP timeout), but the corresponding GoDoc comment was not updated accordingly — it still stated "default: 5 seconds". This stale comment is misleading and can cause confusion for users trying to understand the actual connection behavior.Additionally, the existing comments for both
ConnectionTimeoutandKeepAliveIntervallack sufficient detail about their respective roles and how they interact during connection lifecycle management (TCP dial phase vs. post-connection liveness detection via Ping/Pong), making it difficult for users to properly tune reconnection behavior.Modifications
pulsar/client.go: Fixed the staleConnectionTimeoutdefault value in the comment, and enhanced the GoDoc for bothConnectionTimeoutandKeepAliveIntervalto clarify their roles, default behaviors, and interaction during reconnection.pulsar/internal/helper.go: Added test helper functions to exposeconnectionTimeoutandkeepAliveIntervalfrom the connection pool.pulsar/client_impl_test.go: Added unit tests to verify the default values ofConnectionTimeout(0) andKeepAliveInterval(30s).Verifying this change
This change added tests and can be verified as follows:
TestDefaultConnectionTimeoutto verify the default ConnectionTimeout is 0 (no application-level timeout).TestDefaultKeepAliveIntervalto verify the default KeepAliveInterval is 30s.Does this pull request potentially affect one of the following parts:
Documentation