[CONC-607] Infinite loop in pvio_socket_internal_connect Created: 2022-07-24  Updated: 2022-07-25  Resolved: 2022-07-25

Status: Closed
Project: MariaDB Connector/C
Component/s: Protocol
Affects Version/s: 3.3.1, 3.1.16
Fix Version/s: 3.3.2, 3.1.18

Type: Bug Priority: Major
Reporter: Georg Richter Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: None


 Description   

(copied from PR-204) by Hugo Wen.

There's an infinite loop in function pvio_socket_internal_connect to retry connection forever if receiving specific errno number:

  • No retry interval in the loop which will cause the process consuming all CPU usage and slowdown/stuck other processes.
  • Even if the timeout was set in mysqladmin command option, the function will retry forever in the infinite loop.

The issue was seen a few times when MariaDB server was hanging and not accepting new connection correctly. When the issue happened mysqladmin process consumed 100% CPU usage and stack trace shows it stuck in the loop. Though --connect_timeout was set in command line, mysqladmin will never end until a force kill was executed.


Generated at Thu Feb 08 03:06:31 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.