Bug #104351 CJCommunicationsException: Cannot read packet header with xdevapi.compression

Submitted: 19 Jul 2021 8:42 Modified: 28 Aug 2021 9:53
Reporter: Bernd Wahlen Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:8.0.25 OS:CentOS
Assigned to: CPU Architecture:x86

[19 Jul 2021 8:42] Bernd Wahlen
Description:
i had similar problems with earlier:
https://bugs.mysql.com/bug.php?id=99708

after that bug was fixed and released i successfully removed &xdevapi.compression=DISABLED from connection url,
but i found out, that problems are back (not that often, 2 or 3 times a day).

com.mysql.cj.exceptions.CJCommunicationsException: Cannot read packet header
com.mysql.cj.exceptions.CJCommunicationsException: Cannot read packet header
        at com.mysql.cj.protocol.x.SyncMessageReader.readHeaderLocal(SyncMessageReader.java:142) ~[mysql-connector-java-8.0.25.jar:8.0.25]
        at com.mysql.cj.protocol.x.SyncMessageReader.readHeader(SyncMessageReader.java:90) ~[mysql-connector-java-8.0.25.jar:8.0.25]
        at com.mysql.cj.protocol.x.SyncMessageReader.readHeader(SyncMessageReader.java:60) ~[mysql-connector-java-8.0.25.jar:8.0.25]
        at com.mysql.cj.protocol.x.XProtocol.readQueryResult(XProtocol.java:631) ~[mysql-connector-java-8.0.25.jar:8.0.25]
        at com.mysql.cj.protocol.x.XProtocol.query(XProtocol.java:885) ~[mysql-connector-java-8.0.25.jar:8.0.25]
        at com.mysql.cj.MysqlxSession.query(MysqlxSession.java:170) ~[mysql-connector-java-8.0.25.jar:?]
        at com.mysql.cj.xdevapi.SessionImpl.rollback(SessionImpl.java:141) ~[mysql-connector-java-8.0.25.jar:8.0.25]
        at de.k2interactive.qeep.messaging.MessageXApiImpl.deleteConversationInternal(MessageXApiImpl.java:886) ~[qeep-messaging-55.jar:?]
        at de.k2interactive.qeep.messaging.MessageXApiImpl.deleteConversation(MessageXApiImpl.java:813) ~[qeep-messaging-55.jar:?]
        at de.k2interactive.qeep.match.ContactDaoServiceImpl.deleteContactAndConversation(ContactDaoServiceImpl.java:383) ~[qeep-match-55.jar:?]
        at de.k2interactive.qeep.match.ContactDaoServiceImpl.unmatch(ContactDaoServiceImpl.java:355) ~[qeep-match-55.jar:?]
        ...
        Caused by: java.io.EOFException
        at com.mysql.cj.protocol.x.CompressionSplittedInputStream.readFully(CompressionSplittedInputStream.java:350) ~[mysql-connector-java-8.0.25.jar:8.0.25]
        at com.mysql.cj.protocol.x.CompressionSplittedInputStream.readFully(CompressionSplittedInputStream.java:322) ~[mysql-connector-java-8.0.25.jar:8.0.25]
        at com.mysql.cj.protocol.x.CompressionSplittedInputStream.peekNextFrame(CompressionSplittedInputStream.java:191) ~[mysql-connector-java-8.0.25.jar:8.0.25]
        at com.mysql.cj.protocol.x.CompressionSplittedInputStream.read(CompressionSplittedInputStream.java:147) ~[mysql-connector-java-8.0.25.jar:8.0.25]
        at java.io.FilterInputStream.read(Unknown Source) ~[?:?]
        at com.mysql.cj.protocol.FullReadInputStream.readFully(FullReadInputStream.java:64) ~[mysql-connector-java-8.0.25.jar:?]
        at com.mysql.cj.protocol.FullReadInputStream.readFully(FullReadInputStream.java:53) ~[mysql-connector-java-8.0.25.jar:?]
        at com.mysql.cj.protocol.x.SyncMessageReader.readHeaderLocal(SyncMessageReader.java:137) ~[mysql-connector-java-8.0.25.jar:8.0.25]
        ... 60 more

How to repeat:
the highest chance to get the error is:

ms(s).remove("_id in (" + StringUtil.join(quotedMsgIds) + ")").execute();

with a large number of Ids (normally we delete in chunks of 700-1000 ids, to keep time <250ms).

Suggested fix:
with xdevapi.compression=DISABLED exception never occurs. suggested fix is to change default to disabled until it is really stable.
[28 Jul 2021 9:53] Filipe Silva
Hi Bernd,

Thank you for your interest in MySQL and Connector/J.

We need a reproducible test case so that we can help you.
[29 Aug 2021 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

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

Page generated in 0.039 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.