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

Resolve Consul connection leaks by using SimpleURIConnectionPool #1657

Merged
merged 62 commits into from
Mar 16, 2023
Merged
Show file tree
Hide file tree
Changes from 61 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
39ddeda
additional log messages to track http2clientconnectionpool
miklish Feb 9, 2023
9d0ab4e
initial commit of new connection pool
miklish Feb 9, 2023
53a9107
second version
miklish Feb 12, 2023
e6627e8
2nd version
miklish Feb 12, 2023
24cf0a9
3rd version
miklish Feb 12, 2023
e213332
3rd version - no state enums + bug fix
miklish Feb 12, 2023
04d9c45
4th version - wrap low-level connection in SimpleConnection (and use …
miklish Feb 12, 2023
14aaf38
update to ConsulClientImpl to work with new SimpleConnectionMaker (co…
miklish Feb 12, 2023
f796c05
change to 4th version - remove de-paramaterize SimpleConnection for now
miklish Feb 12, 2023
2d18927
version 4 - after package refactoring - separate undertow connection …
miklish Feb 12, 2023
69cd257
update ConsulClientImpl to use refactored packages
miklish Feb 12, 2023
24395c6
small updates
miklish Feb 13, 2023
c305a10
update argument names in SimpleCOnnectionMaker and implementing class…
miklish Feb 13, 2023
f691d3a
1. made using low level connections easier by adding getRawConnectio…
miklish Feb 13, 2023
c7a2270
update variable name holder -> connectionHolder
miklish Feb 14, 2023
69a9dbe
first attempt to handle connection leak - look for concurrent modific…
miklish Feb 15, 2023
c83b625
make sure closed leaked connections are garbage collected
miklish Feb 15, 2023
4e18d0b
removed unnecessary use of connection future when reusing an already-…
miklish Feb 16, 2023
3f6b6e1
updated documentation
miklish Feb 16, 2023
162c758
updated docs and some vraiable names for increased clarity
miklish Feb 16, 2023
441d465
added additional docs to SimpleConnection
miklish Feb 20, 2023
d2a07e6
updated docs and also made all logging-helper methods private and non…
miklish Feb 20, 2023
cbc979c
made numerous methods private and non-synchronized since they are onl…
miklish Feb 20, 2023
ac4335f
added thread saftety warnings to methods for whom the synchronized ke…
miklish Feb 21, 2023
c892834
simplified connection leak checking code
miklish Feb 22, 2023
4d9af96
fixed a ConcurrentModificationException bug in readAllHolders, and op…
miklish Feb 22, 2023
b3f0fed
first test adding the use of iterators for connection state sweeps
miklish Feb 22, 2023
8f61d0f
handle all element-removals from sets that are being iterated over us…
miklish Feb 22, 2023
27721a1
simplfied some variable names
miklish Feb 24, 2023
dceb271
Changed log message ('attempt to close') to less alarming 'closing co…
miklish Feb 24, 2023
5717f13
SimpleURIConnectionPool: 1) ensure that both pool-closed and unexpect…
miklish Feb 24, 2023
b73821d
ConsulThreadMonitor: 1) added a minimum time to give processes to che…
miklish Feb 24, 2023
49fd341
added option to force the use of HTTP/1.1 connections to Consul
miklish Feb 25, 2023
630d038
SimpleURIConnectionPool: 1) Simplified logic of readAllConnectionHold…
miklish Feb 25, 2023
25c79da
SimpleURIConnectionPool: Simplified updateSet()
miklish Feb 25, 2023
613ea7e
Updated documentation
miklish Feb 25, 2023
8ba496c
Refinements: SimpleConnectionHolder: 1) Made ConnectionToken construc…
miklish Feb 26, 2023
00e1122
refined variable names in untracked-connection checker
miklish Feb 26, 2023
dfbfc55
SimpleConnectionHandler: Minor variable name refinements. Made firstU…
miklish Feb 28, 2023
a0ec0c1
Fixed issue in SimpleURIConnectionPool.readAllConnectionHolders(): If…
miklish Feb 28, 2023
f68a7cb
1) Separated test runners from tests and mock connections, 2) create…
miklish Mar 6, 2023
a2c31bf
fixed typo in docs
miklish Mar 6, 2023
1cbf30e
1) Updated some log messages. 2) added additional docs
miklish Mar 6, 2023
7b8c67e
Added additional docs
miklish Mar 6, 2023
9b6f486
1) Updated docs, 2) made some fields final, 3) added throws clause …
miklish Mar 6, 2023
42a8494
1) fixed bug / clarified code in borrow() method (L65) that handles c…
miklish Mar 6, 2023
1841455
Deleted SimpleForeverConnection (replaced by MockKeepAliveConnection)
miklish Mar 6, 2023
7d3e0f9
Made the connection-creation timeout explicit in the test setup
miklish Mar 6, 2023
a1123c5
streamlined the java reflection code in TestRunner.instantiateConnect…
miklish Mar 7, 2023
90c996f
made executor final in TestRunner.instantiateConnection()
miklish Mar 7, 2023
80523f4
cleaned text
miklish Mar 7, 2023
fb59ee1
Move example mock tests to sub-package mockexample in simplepool.mock
miklish Mar 9, 2023
dce2731
move mockexample package into mock package
miklish Mar 9, 2023
7526d7d
Revert changes back to 1.6.44
miklish Mar 9, 2023
3673f4e
Revert changes back to 1.6.44 then replace usage of Http2ClientConnec…
miklish Mar 9, 2023
8c9b037
Removed reference to Mock connection
miklish Mar 9, 2023
938937c
Removed need for synchronized connection to create single ConsulThrea…
miklish Mar 9, 2023
57b5c88
Cleaned up example test code, and renamed some properties to better e…
miklish Mar 11, 2023
3b8542e
Merge branch '1.6.x' into simplepool1645
miklish Mar 14, 2023
18cd028
replaced greater / less than symbols in javadoc with escapes
miklish Mar 14, 2023
54a8f2e
add license and attributions
miklish Mar 14, 2023
fd8b59e
Added attributions for test/QA team
miklish Mar 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @author miklish Michael N. Christoff
*/

package com.networknt.client.simplepool;

/***
* SimpleConnection is an interface that contains all the required functions and properties of
* a connection that are needed by the SimpleConnectionHolder, SimpleURIConnectionPool, and
* SimpleConnectionPool classes.
*
* Concrete HTTP network connections (like Undertow's ClientConnection class) should be wrapped in
* classes that implement the SimpleConnection interface.
*
*/
public interface SimpleConnection {
/**
* Tells whether or not the connection is open
* @return returns true iff the raw connection is open
*/
public boolean isOpen();

/**
* Returns the raw connection object. This must always be non-null
* @return returns the raw connection object
*/
public Object getRawConnection();

/**
* Tells whether the connection supports HTTP/2 connection multiplexing
* @return returns true iff the connection supports HTTP/2 connection multiplexing
*/
public boolean isMultiplexingSupported();

/**
* Returns the client side address of the connection
* @return the client side address of the connection
*/
public String getLocalAddress();

/**
* Safely closes the connection
*/
public void safeClose();
}
Loading