Bug #46637 CommunicationsException has bad message when no packets received by server

Submitted: 10 Aug 2009 20:56 Modified: 16 Sep 2009 16:00
Reporter: Mark Matthews Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:5.1 OS:Any
Assigned to: CPU Architecture:Any

[10 Aug 2009 20:56] Mark Matthews
Description:
When the driver encounters an error condition that causes it to create a CommunicationsException, it tries to build a friendly error message that helps diagnose what is wrong.

However, if there has been no network packets received from the server, the error message contains this bogus text:

"The last packet successfully received from the server was 1,249,932,468,916 milliseconds ago.  The last packet sent successfully to the server was 0 milliseconds ago."

How to repeat:
By inspection.

Suggested fix:
Don't calculate a delta from "now", if no packet(s) have ever been received from the server.
[10 Aug 2009 21:03] Mark Matthews
Fixed for 5.1.9.
[16 Sep 2009 16:00] Tony Bedford
An entry was added to the 5.1.9 changelog:

When Connector/J encountered an error condition that caused it to create a CommunicationsException, it tried to build a friendly error message that helped diagnose what was wrong. However, if there had been no network packets received from the server, the error message contained the following incorrect text:

The last packet successfully received from the server was 1,249,932,468,916 milliseconds
ago.  The last packet sent successfully to the server was 0 milliseconds ago.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.038 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.