summaryrefslogtreecommitdiff
path: root/mysys/my_fopen.c
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2019-05-04 13:11:25 +0200
committerSergei Golubchik <serg@mariadb.org>2019-05-07 18:40:36 +0200
commit15c79c41e435758392a1474fccf45978fec1e45c (patch)
tree434cf1c13283cb5abd236b8b8068127cec06b6ba /mysys/my_fopen.c
parent3d7e06d4ab1c108d61ac7dd4d09287580d77add5 (diff)
downloadmariadb-git-15c79c41e435758392a1474fccf45978fec1e45c.tar.gz
MDEV-17845 Extreme high open file limit used
SHOW STATUS LIKE 'Open_files' was showing 18446744073709551615 my_file_opened used statistic_increment/statistic_decrement, so one-off errors were normal and expected. But they confused monitoring tools, so let's move my_file_opened to use atomics.
Diffstat (limited to 'mysys/my_fopen.c')
-rw-r--r--mysys/my_fopen.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mysys/my_fopen.c b/mysys/my_fopen.c
index fbd84049700..e33d9d67925 100644
--- a/mysys/my_fopen.c
+++ b/mysys/my_fopen.c
@@ -223,7 +223,7 @@ FILE *my_fdopen(File Filedes, const char *name, int Flags, myf MyFlags)
{
if (my_file_info[Filedes].type != UNOPEN)
{
- statistic_decrement(my_file_opened, &THR_LOCK_open); /* File is opened with my_open ! */
+ thread_safe_decrement32(&my_file_opened); /* File is opened with my_open ! */
}
else
{