mirror of
https://github.com/postgres/postgres.git
synced 2025-10-29 22:49:41 +03:00
Remove libpq's use of abort(3) to handle mutex failure cases.
Doing an abort() seems all right in development builds, but not in production builds of general-purpose libraries. However, the functions that were doing this lack any way to report a failure back up to their callers. It seems like we can just get away with ignoring failures in production builds, since (a) no such failures have been reported in the dozen years that the code's been like this, and (b) failure to enforce mutual exclusion during fe-auth.c operations would likely not cause any problems anyway in most cases. (The OpenSSL callbacks that use this macro are obsolete, so even less likely to cause interesting problems.) Possibly a better answer would be to break compatibility of the pgthreadlock_t callback API, but in the absence of field problem reports, it doesn't really seem worth the trouble. Discussion: https://postgr.es/m/3131385.1624746109@sss.pgh.pa.us
This commit is contained in:
@@ -626,13 +626,6 @@ extern bool pqGetHomeDirectory(char *buf, int bufsize);
|
||||
#ifdef ENABLE_THREAD_SAFETY
|
||||
extern pgthreadlock_t pg_g_threadlock;
|
||||
|
||||
#define PGTHREAD_ERROR(msg) \
|
||||
do { \
|
||||
fprintf(stderr, "%s\n", msg); \
|
||||
abort(); \
|
||||
} while (0)
|
||||
|
||||
|
||||
#define pglock_thread() pg_g_threadlock(true)
|
||||
#define pgunlock_thread() pg_g_threadlock(false)
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user