Skip to content

Commit

Permalink
lock.c: Fix artificially low MAX_READERS limit.
Browse files Browse the repository at this point in the history
The MAX_READERS value was reduced initially for testing;
bump it up significantly to prevent warnings when there
are more than 5 read locks held, which can happen in
normal usage, particularly with TLS.
  • Loading branch information
InterLinked1 committed Feb 11, 2024
1 parent 1bab0d4 commit 5f5648b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bbs/lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@
#define DETECT_DEADLOCKS
#define STRICT_LOCKING
#define ALWAYS_INITIALIZE 1
#define MAX_READERS 5

/* In general, there should not be *that* many readers for a lock.
* However, tls.c currently requires a read lock for every TLS
* connection, so this should be at least as high as maxnodes in nodes.conf,
* for worst case scenario of every node using TLS encryption. */
#define MAX_READERS 128

/* Start code */
#define BBS_LOCK_WRAPPER_FILE
Expand Down

0 comments on commit 5f5648b

Please sign in to comment.