Skip to content

Clarify SocketConnectionBase exception handling flow report.#1678

Merged
vietj merged 1 commit into
5.1from
socket-connection-base-exception-handling-5.1
Jun 19, 2026
Merged

Clarify SocketConnectionBase exception handling flow report.#1678
vietj merged 1 commit into
5.1from
socket-connection-base-exception-handling-5.1

Conversation

@vietj

@vietj vietj commented Jun 19, 2026

Copy link
Copy Markdown
Member

Motivation:

SocketConnectionBase handleException method should only be called by the underlying socket exception handler, when it happens the close handler will be called subsequently by the socket.

Changes:

Instead of calling the internal handleClose from the handleException method, we should capture the exception reported and reuse it when handleClosed is called.

Remove the handleException call from the try/catch block in handleMessage, handleMessage should never throw an exception, if it does, it will be logged by the socket calling handleMessage (that would be a bug).

Remove the PgSocketConnection handleException override that reports the exception, since now the base method will capture the exception, the handleClose will call reportException instead.

Remove unused DB2SocketConnection code that was doing nothing.

Make a few methods private to SocketConnectionBase to ensure they are only called in an expected way.

Motivation:

SocketConnectionBase handleException method should only be called by the underlying socket exception handler, when it happens the close handler will be called subsequently by the socket.

Changes:

Instead of calling the internal handleClose from the handleException method, we should capture the exception reported and reuse it when handleClosed is called.

Remove the handleException call from the try/catch block in handleMessage, handleMessage should never throw an exception, if it does, it will be logged by the socket calling handleMessage (that would be a bug).

Remove the PgSocketConnection handleException override that reports the exception, since now the base method will capture the exception, the handleClose will call reportException instead.

Remove unused DB2SocketConnection code that was doing nothing.

Make a few methods private to SocketConnectionBase to ensure they are only called in an expected way.
@vietj vietj added this to the 5.1.3 milestone Jun 19, 2026
@vietj vietj merged commit 261ca55 into 5.1 Jun 19, 2026
18 checks passed
@vietj vietj deleted the socket-connection-base-exception-handling-5.1 branch June 19, 2026 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant