Bug 1584023 - systemctl start mariadb - hangs if sock file is used by another process [rhel-7.5.z]
Summary: systemctl start mariadb - hangs if sock file is used by another process [rhel...
Keywords:
Status: CLOSED ERRATA
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: Karel Volný
URL:
Whiteboard:
Depends On: 1145455
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-05-30 07:46 UTC by Oneata Mircea Teodor
Modified: 2018-08-16 14:19 UTC (History)
9 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: 1145455
Environment:
Last Closed: 2018-08-16 14:17:20 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:2439 None None None 2018-08-16 14:19:49 UTC

Description Oneata Mircea Teodor 2018-05-30 07:46:31 UTC
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 13:30:47 UTC
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 15:44:19 UTC
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 16:28:32 UTC
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 10:33:26 UTC
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 10:59:10 UTC
re comment 7, 8 - there are a few other issues, e.g. bug 1598095

Comment 12 errata-xmlrpc 2018-08-16 14:17:20 UTC
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.