RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1145455 - systemctl start mariadb - hangs if sock file is used by another process
Summary: systemctl start mariadb - hangs if sock file is used by another process
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: mariadb
Version: 7.1
Hardware: Unspecified
OS: Unspecified
high
low
Target Milestone: rc
: ---
Assignee: Michal Schorm
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks: 1400961 1472751 1584023
TreeView+ depends on / blocked
 
Reported: 2014-09-23 06:33 UTC by Branislav Blaškovič
Modified: 2018-10-30 15:42 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Previously, the mysqladmin tool waited for an inadequate length of time if the socket it listened on did not respond in a specific way. Consequently, when the socket was used while the MariaDB server was starting, the mariadb service became unresponsive for a long time. With this update, the mysqladmin timeout has been shortened to 2 seconds. As a result, the mariadb service either starts or fails but no longer hangs in the described situation.
Clone Of:
: 1584023 (view as bug list)
Environment:
Last Closed: 2018-10-30 15:42:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Branislav Blaškovič 2014-09-23 06:33:06 UTC
Description of problem:
If I listen on sock file which is the same for mariadb, starting of mariadb service hangs.

Version-Release number of selected component (if applicable):
mariadb-server-5.5.35-3.el7.x86_64

How reproducible:
always

Steps to Reproduce:
# systemctl stop mariadb
# ls /var/lib/mysql/mysql.sock
ls: cannot access /var/lib/mysql/mysql.sock: No such file or directory
# nc -k -l -U /var/lib/mysql/mysql.sock &
# chown mysql:mysql /var/lib/mysql/mysql.sock
# restorecon -v /var/lib/mysql/mysql.sock
restorecon reset /var/lib/mysql/mysql.sock context unconfined_u:object_r:mysqld_db_t:s0->unconfined_u:object_r:mysqld_var_run_t:s0
# systemctl start mariadb
.. it hangs here ..

Comment 2 Honza Horak 2015-03-14 19:38:51 UTC
This issue is caused by mysqladmin pinging the socket file and this tool expects the socket responds in a specific way, which doesn't happen (nc doesn't respond) and the mysqladmin tool waits for too long time by default. This time may either be shortened by using --connect-timeout=10 for example (shortens the hang to 10s) or better to use a check if socket is used before actually starting the daemon process, similar to what Fedora does:

http://pkgs.fedoraproject.org/cgit/mariadb.git/tree/mysql-check-socket.sh?id=c9d7d6f31d5f8ad7979201b65c03cb7fec4fd157

What is important, this shouldn't be a real issue, since if another mysql daemon is using the socket, the daemon's respond is sane and mysqladmin doesn't hang.


Note You need to log in before you can comment on or make changes to this bug.