Skip to content

Clarify SocketConnectionBase exception handling flow report.#1677

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

Clarify SocketConnectionBase exception handling flow report.#1677
vietj merged 1 commit into
masterfrom
socket-connection-base-exception-handling

Conversation

@vietj

@vietj vietj commented Jun 17, 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.

@vietj vietj added this to the 5.2.0 milestone Jun 17, 2026
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 force-pushed the socket-connection-base-exception-handling branch from fc4a61a to e2b708e Compare June 19, 2026 12:26
@vietj vietj merged commit 2d579e7 into master Jun 19, 2026
19 checks passed
@vietj vietj deleted the socket-connection-base-exception-handling 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