[MDEV-18420] Increase OS_FILE_LIMIT to ULLONG_MAX Created: 2019-01-29  Updated: 2020-11-11

Status: Open
Project: MariaDB Server
Component/s: Variables
Fix Version/s: None

Type: Task Priority: Minor
Reporter: Geoff Montee (Inactive) Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-18410 Can't set mysqld_safe's open-files-li... Open

 Description   

MariaDB uses open_files_limit to set its limit on open file descriptors with setrlimit:

https://github.com/MariaDB/server/blob/5abc79dd7ab2fccb4b05ca38a512ec816d2f8e52/mysys/my_file.c#L42

And it only allows a maximum limit of OS_FILE_LIMIT:

https://github.com/MariaDB/server/blob/5abc79dd7ab2fccb4b05ca38a512ec816d2f8e52/mysys/my_file.c#L102

https://github.com/MariaDB/server/blob/78829a5780d3e48da376c1ca4e62731da450c551/sql/sys_vars.cc#L2434

And OS_FILE_LIMIT is currently defined as UINT_MAX (4294967295):

https://github.com/MariaDB/server/blob/8dc460b844dcb8a8ef70396bfaf932010076b9a3/include/my_global.h#L695

RLIMIT_INFINITY seems to be defined as ULLONG_MAX on my system:

$ grep "RLIM_INFINITY" /usr/include/bits/resource.h
# define RLIM_INFINITY ((__rlim_t) -1)
# define RLIM_INFINITY 0xffffffffffffffffuLL
#define RLIM_SAVED_MAX  RLIM_INFINITY
#define RLIM_SAVED_CUR  RLIM_INFINITY

So if we increased OS_FILE_LIMIT to ULLONG_MAX, it looks like we could allow users to set an infinite limit.


Generated at Thu Feb 08 08:43:58 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.