Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1584023 - systemctl start mariadb - hangs if sock file is used by another process [rhel-7.5.z]
systemctl start mariadb - hangs if sock file is used by another process [rhel...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: mariadb (Show other bugs)
7.1
Unspecified Unspecified
high Severity low
: rc
: ---
Assigned To: Michal Schorm
Karel Volný
: ZStream
Depends On: 1145455
Blocks:
  Show dependency treegraph
 
Reported: 2018-05-30 03:46 EDT by Oneata Mircea Teodor
Modified: 2018-08-16 10:19 EDT (History)
9 users (show)

See Also:
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.
Story Points: ---
Clone Of: 1145455
Environment:
Last Closed: 2018-08-16 10:17:20 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:2439 None None None 2018-08-16 10:19 EDT

  None (edit)
Description Oneata Mircea Teodor 2018-05-30 03:46:31 EDT
This bug has been copied from bug #1145455 and has been proposed to be backported to 7.5 z-stream (EUS).
Comment 6 Karel Volný 2018-07-02 09:30:47 EDT
I cannot test this using the original reproducer because the initscript seems to exit as soon as it finds that another process is hanging on the socket ... any hints?
Comment 7 Karel Volný 2018-07-03 11:44:19 EDT
now this is interesting - after modifying the reproducer to initialise the database at first, i.e. starting and stopping the daemon before, the daemon just starts, no matter that /var/lib/mysql/mysql.sock is used by nc ...
Comment 8 Karel Volný 2018-07-03 12:28:32 EDT
to be precise:

:: [ 12:25:38 ] :: [   PASS   ] :: File /var/lib/mysql/mysql.sock should exist 
srwxr-xr-x. mysql mysql unconfined_u:object_r:mysqld_var_run_t:s0 /var/lib/mysql/mysql.sock
:: [ 12:25:38 ] :: [  BEGIN   ] :: Socket opened by nc should contain /var/lib/mysql/mysql.sock :: actually running 'lsof -U -a -c nc | grep '/var/lib/mysql/mysql.sock''
nc      4873 root    3u  unix 0xffff99f38b7b6c00      0t0 63649 /var/lib/mysql/mysql.sock

...

:: [ 12:25:43 ] :: [   FAIL   ] :: Trying to start mariadb (should fail) (Expected 1, got 0)

...

:: [ 12:25:53 ] :: [   FAIL   ] :: Checking mariadb status (should not be running) (Expected 3, got 0)
:: [ 12:25:53 ] :: [   PASS   ] :: File /var/lib/mysql/mysql.sock should exist 
srwxrwxrwx. mysql mysql system_u:object_r:mysqld_var_run_t:s0 /var/lib/mysql/mysql.sock
COMMAND  PID  USER   FD   TYPE             DEVICE SIZE/OFF  NODE NAME
nc      4873  root    3u  unix 0xffff99f38b7b6c00      0t0 63649 /var/lib/mysql/mysql.sock
mysqld  5168 mysql   15u  unix 0xffff99f38ae99800      0t0 64204 /var/lib/mysql/mysql.sock


so, obviously, mariadb overlays the socket file somehow ...
Comment 9 Karel Volný 2018-07-04 06:33:26 EDT
in /usr/libexec/mariadb-wait-ready there is now connect-timeout added:

RESPONSE=`/usr/bin/mysqladmin --no-defaults --connect-timeout=2 --socket="$socketfile" --user=UNKNOWN_MYSQL_USER ping 2>&1`
Comment 10 Karel Volný 2018-07-04 06:59:10 EDT
re comment 7, 8 - there are a few other issues, e.g. bug 1598095
Comment 12 errata-xmlrpc 2018-08-16 10:17:20 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:2439

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