You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have identified a potential bug in the recreateConnection function in pool.go file. When there is an issue with the connection, the function attempts to recreate it. However, if an error is thrown during this process, the function currently uses a return statement, which causes the goroutine to stop. As a result, the connection is never successfully recreated.
To address this issue, the return statement should be replaced with a continue statement. This change will ensure that the goroutine continues to run and will keep attempting to re-establish the connection until it is successful.
Example to Simulate the Issue:
Establish the Initial Connection:
Start the main service and establish a connection to a test service.
Stop the Test Service:
Manually stop the test service to simulate a connection issue.
Wait for a Duration:
Keep the test service stopped for a duration longer than the value configured in the PoolReconnectWait option.
Observe the Error Message:
You should see the following line in the main service logs:
"failed to re-create connection for...."
Re-Start the Test Service:
Restart the test service. Notice that the connection is never re-established, confirming the bug.
Apply the Fix:
Modify the recreateConnection function by replacing the return statement with a continue statement.
Test the Fix:
Restart the main service and repeat the steps above. This time, the connection should be successfully re-established after the test service is restarted.
The text was updated successfully, but these errors were encountered:
Description:
We have identified a potential bug in the recreateConnection function in pool.go file. When there is an issue with the connection, the function attempts to recreate it. However, if an error is thrown during this process, the function currently uses a return statement, which causes the goroutine to stop. As a result, the connection is never successfully recreated.
iso8583-connection/pool.go
Line 221 in d11002c
Proposed Fix:
To address this issue, the
return
statement should be replaced with acontinue
statement. This change will ensure that the goroutine continues to run and will keep attempting to re-establish the connection until it is successful.Example to Simulate the Issue:
Establish the Initial Connection:
Stop the Test Service:
Wait for a Duration:
PoolReconnectWait
option.Observe the Error Message:
Re-Start the Test Service:
Apply the Fix:
recreateConnection
function by replacing thereturn
statement with acontinue
statement.Test the Fix:
The text was updated successfully, but these errors were encountered: