mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-17 02:53:51 +08:00
Fix assert in debug wait points
Need to ensure that we should try to take a lock only if a valid transaction is around. Otherwise assert is hit due to an error within an error. Fixes #5917
This commit is contained in:
parent
2eb0a3883b
commit
592da23633
@ -11,6 +11,7 @@
|
||||
#include <fmgr.h>
|
||||
|
||||
#include <access/hash.h>
|
||||
#include <access/xact.h>
|
||||
#include <storage/ipc.h>
|
||||
#include <storage/lock.h>
|
||||
#include <miscadmin.h>
|
||||
@ -177,6 +178,10 @@ ts_debug_point_wait(const char *name, bool blocking)
|
||||
LockAcquireResult lock_acquire_result pg_attribute_unused();
|
||||
bool lock_release_result pg_attribute_unused();
|
||||
|
||||
/* Ensure that we are in a transaction before trying for locks */
|
||||
if (!IsTransactionState())
|
||||
return;
|
||||
|
||||
debug_point_init(&point, name);
|
||||
|
||||
ereport(DEBUG3, (errmsg("waiting on debug point '%s'", point.name)));
|
||||
|
Loading…
x
Reference in New Issue
Block a user