Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Report: When using MySQL without mysqld_safe a stale lock file prevents restarts #14552

Open
dbussink opened this issue Nov 20, 2023 · 2 comments · Fixed by #14553 or #14600
Open

Comments

@dbussink
Copy link
Contributor

Overview of the Issue

When we run MySQL with mysqlctld but without mysqld_safe and MySQL has an OOM issue, it stops with leaving a lock file in place for the MySQL socket.

In case of mysqlctld though, we know that we manage mysqld and that we can safely restart, making it more robust against issues like OOM in this scenario.

Reproduction Steps

Run mysqld with mysqlctld but without mysqld_safe. In case MySQL OOMs, it won't restart MySQL.

Binary Version

-

Operating System and Environment details

-

Log Fragments

I1119 20:13:57.325598       1 mysqld.go:388] Mysqld.Start(1700424834) stderr: 2023-11-19T20:13:57.325526Z 0 [ERROR] [MY-010119] [Server] Aborting
I1119 20:13:57.325590       1 mysqld.go:388] Mysqld.Start(1700424834) stderr: 2023-11-19T20:13:57.325512Z 0 [ERROR] [MY-010268] [Server] Unable to setup unix socket lock file.
I1119 20:13:57.325549       1 mysqld.go:388] Mysqld.Start(1700424834) stderr: 2023-11-19T20:13:57.325477Z 0 [ERROR] [MY-010259] [Server] Another process with pid 15 is using unix socket file.
@dbussink
Copy link
Contributor Author

Looks like #14553 doesn't not properly fix this, as there can be a newline in the file and it then fails with:

E1124 14:11:50.284750       1 mysqld.go:450] Mysqld.Start(1700835110): error parsing pid from lock file: strconv.Atoi: parsing "162\n": invalid syntax
E1124 14:11:50.284993       1 mysqlctld.go:125] failed to start mysqld: strconv.Atoi: parsing "162\n": invalid syntax

@dbussink
Copy link
Contributor Author

dbussink commented Mar 5, 2024

Reopening this one as there's still cases where this can happen. One theory is that it could be that mysqlctld gets assigned the same PID as in the lock file.

Additionally, we can improve the logging to see more information about the other process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant