[MXS-1377] maxscale doesn't cleanup pid file on startup error Created: 2017-08-24  Updated: 2017-09-20  Resolved: 2017-09-20

Status: Closed
Project: MariaDB MaxScale
Component/s: Core
Affects Version/s: 2.1.6
Fix Version/s: 2.1.9

Type: Bug Priority: Major
Reporter: Andrii Nikitin (Inactive) Assignee: Johan Wikman
Resolution: Fixed Votes: 0
Labels: None

Sprint: 2017-42

 Description   

$ ls -la | grep pid
$ maxscale
* Error: Failed to start all MaxScale services. Exiting.
$ cat s1-2.1.6/log/maxscale.log | grep -i error 
2017-08-24 08:17:29   error  : [mysqlmon] No Master can be determined
2017-08-24 08:17:30   error  : [MySQLAuth] [Read-Service] Failed to connect to server 'm1' ([127.0.0.1]:3307) when checking authentication user credentials and permissions: 1045 Access denied for user 'galera'@'localhost' (using password: YES)
2017-08-24 08:17:30   error  : [MySQLAuth] [Read-Service] Failed to connect to server 'm2' ([127.0.0.1]:3308) when checking authentication user credentials and permissions: 1045 Access denied for user 'galera'@'localhost' (using password: YES)
2017-08-24 08:17:30   error  : [Read-Service] Fatal error when loading users for listener 'Read Listener', service is not started.
2017-08-24 08:17:30   error  : [MySQLAuth] [Read-Service] Failed to connect to server 'm1' ([127.0.0.1]:3307) when checking authentication user credentials and permissions: 1045 Access denied for user 'galera'@'localhost' (using password: YES)
2017-08-24 08:17:30   error  : [MySQLAuth] [Read-Service] Failed to connect to server 'm2' ([127.0.0.1]:3308) when checking authentication user credentials and permissions: 1045 Access denied for user 'galera'@'localhost' (using password: YES)
2017-08-24 08:17:30   error  : [Read-Service] Fatal error when loading users for listener 'Read Listener', service is not started.
2017-08-24 08:17:30   error  : Failed to start service 'Read-Service'.
2017-08-24 08:17:30   error  : Failed to start all MaxScale services. Exiting.
$ ls -la | grep pid
-rwxr-xr-x  1 buildbot buildbot    5 Aug 24 08:17 maxscale.pid
$ ps auxwww | grep $(cat maxscale.pid)
buildbot 21579  0.0  0.0  12728  2180 pts/0    R+   08:21   0:00 grep 21540
$ pidof maxscale
$ echo $?
1

In my understanding it is required that pid file is removed properly to make sure that clean service restart is possible.



 Comments   
Comment by markus makela [ 2017-08-24 ]

Seems that it cleans it up only on a clean exit. The reason why this has gone unnoticed is probably due to the added logic in the pid file creation code that checks that a valid process exists before overwriting the old file with the new pid.

This does not prevent the case where another process with the same pid is created. In this case, MaxScale will fail to start even when it should start successfully.

Comment by Johan Wikman [ 2017-09-20 ]

MaxScale will now always delete the pid-file.

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