Skip to content
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

[PIP-165] Auto release idle connections #963

Merged
merged 10 commits into from
Mar 3, 2023

Conversation

RobertIndie
Copy link
Member

@RobertIndie RobertIndie commented Feb 23, 2023

Motivation

The go implementation of PIP-165:apache/pulsar#15516

Modifications

  • Add new configuration ConnectionMaxIdleTime to ClientOptions
  • Add a goroutine to ConnectionPool to period check and release idle connections.

Verifying this change

This change added tests

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

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API: (yes / no)
  • The schema: (yes / no / don't know)
  • The default values of configurations: (yes / no)
  • The wire protocol: (yes / no)

Documentation

  • Does this pull request introduce a new feature? (yes)
  • If yes, how is the feature documented? ( GoDocs)
  • If a feature is not applicable for documentation, explain why?
  • If a feature is not documented yet in this PR, please create a followup issue for adding the documentation

@shibd
Copy link
Member

shibd commented Mar 1, 2023

@RobertIndie

It seems that the newly added unit test has a timeout.

time="2023-03-01T10:41:21Z" level=info msg="Connecting to broker" remote_addr="pulsar://localhost:6650"
time="2023-03-01T10:41:21Z" level=info msg="TCP connection established" local_addr="127.0.0.1:42264" remote_addr="pulsar://localhost:6650"
time="2023-03-01T10:41:21Z" level=info msg="Connection is ready" local_addr="127.0.0.1:42264" remote_addr="pulsar://localhost:6650"
    client_impl_test.go:1224: 
        	Error Trace:	/pulsar/pulsar-client-go/pulsar/client_impl_test.go:1224
        	Error:      	Expected nil, but got: &errors.errorString{s:"request timed out"}
        	Test:       	TestAutoCloseIdleConnection
coverage: 29.7% of statements
panic: test timed out after 20m0s

pulsar/client_impl.go Outdated Show resolved Hide resolved
@RobertIndie
Copy link
Member Author

@RobertIndie

It seems that the newly added unit test has a timeout.

time="2023-03-01T10:41:21Z" level=info msg="Connecting to broker" remote_addr="pulsar://localhost:6650"
time="2023-03-01T10:41:21Z" level=info msg="TCP connection established" local_addr="127.0.0.1:42264" remote_addr="pulsar://localhost:6650"
time="2023-03-01T10:41:21Z" level=info msg="Connection is ready" local_addr="127.0.0.1:42264" remote_addr="pulsar://localhost:6650"
    client_impl_test.go:1224: 
        	Error Trace:	/pulsar/pulsar-client-go/pulsar/client_impl_test.go:1224
        	Error:      	Expected nil, but got: &errors.errorString{s:"request timed out"}
        	Test:       	TestAutoCloseIdleConnection
coverage: 29.7% of statements
panic: test timed out after 20m0s

@shibd Thanks. It's a deadlock issue. I have fixed it.

@RobertIndie RobertIndie merged commit 75d2df3 into apache:master Mar 3, 2023
@RobertIndie RobertIndie added this to the v0.10.0 milestone Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants