Skip to content

Conversation

@svoj
Copy link
Contributor

@svoj svoj commented Nov 4, 2025

Test was affected by incompletely closed preceding connections.

Wait for preceding connections to decrement Threads_connected before testing ER_CON_COUNT_ERROR condition.

@svoj svoj requested a review from Copilot November 4, 2025 10:54
@svoj svoj added the MariaDB Foundation Pull requests created by MariaDB Foundation label Nov 4, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds session synchronization logic to the MDEV-375 test to ensure test stability. The change waits for the session count to reach 1 before proceeding with the test execution.

  • Added session count verification before modifying global variables

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vuvova
Copy link
Member

vuvova commented Nov 6, 2025

what does it fix? MDEV-10608 says the failure is

mysqltest: At line 9: query 'connect  con1,localhost,root,,' failed: 2003: Can't connect to MySQL server on 'localhost' (0 "Internal error/check (Not system error)")

but I see it's failing now as

mysqltest: At line 26: query 'connect  con3,localhost,root,,' failed with wrong errno <Unknown> (2013): 'Can't connect to server (22).', instead of ER_CON_COUNT_ERROR (1040)...

and your fix wouldn't help here. Does this test still fail the old way anywhere?

@svoj
Copy link
Contributor Author

svoj commented Nov 6, 2025

With this sleep()...

diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc
index c279f2663c8..c227fee943e 100644
--- a/sql/sql_connect.cc
+++ b/sql/sql_connect.cc
@@ -1483,6 +1483,7 @@ void do_handle_one_connection(CONNECT *connect, bool put_in_cache)
     if (thd->userstat_running)
       update_global_user_stats(thd, create_user, time(NULL));

+    sleep(1);
     unlink_thd(thd);
     if (IF_WSREP(thd->wsrep_applier, false) || !put_in_cache ||
         !(connect= thread_cache.park()))

...the failure on my host is:

CURRENT_TEST: main.mdev375
mysqltest: At line 24: query 'connect  con2,localhost,root,,' failed: ER_CON_COUNT_ERROR (1040): Too many connections

The result from queries just before the failure was:
set @save_log_warnings=@@log_warnings, @save_max_connections=@@max_connections;
SET GLOBAL log_warnings=4;
SET GLOBAL max_connections=10;
connect  tmp_con1,localhost,root,,;
connect  tmp_con2,localhost,root,,;
connect  tmp_con3,localhost,root,,;
connect  tmp_con4,localhost,root,,;
connect  tmp_con5,localhost,root,,;
connect  tmp_con6,localhost,root,,;
connect  tmp_con7,localhost,root,,;
connect  tmp_con8,localhost,root,,;
connect  con1,localhost,root,,;
SELECT 1;
1
1

This failure is present in buildbot too: https://buildbot.mariadb.org/#/builders/644/builds/11740/steps/6/logs/stdio. But it is much less frequent compared to the con3 failure on aarch64-macos that you've outlined. And yes, it is correct that my fix won't help here.

The failure from MDEV-10608, I will need some time to analyze it. Will get back to you shortly.

@svoj svoj changed the title MDEV-10608 - main.mdev375 fails sporadically in buildbot MDEV-38076 - main.mdev375 fails sporadically Nov 12, 2025
Test was affected by incompletely closed preceding connections.

Wait for preceding connections to decrement Threads_connected
before testing ER_CON_COUNT_ERROR condition.
@svoj svoj force-pushed the pr-10.11-MDEV-10608 branch from 33b8aa8 to e55576a Compare November 12, 2025 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

MariaDB Foundation Pull requests created by MariaDB Foundation

Development

Successfully merging this pull request may close these issues.

2 participants