Skip to content

Commit d4e1f97

Browse files
maksm90akorotkov
authored andcommitted
Fix termination of sequential scans of sample profile hash table
When pg_wait_sampling sends a sample profile to caller backend it initializes a new session of sequential scan for internal hash table. This session is tracked by internal counter 'num_seq_scans' that is bound above by some constant thresold. If caller interrupts process of profile receiving from message queue collector doesn't decrement internal counter of hash table that cause its threshold crossing. Thus fix releases a sequencial scan session explicitely even if abort of interaction process was appeared.
1 parent e6f52a7 commit d4e1f97

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

collector.c

+1
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ send_profile(HTAB *profile_hash, shm_mq_handle *mqh)
266266
mq_result = shm_mq_send(mqh, sizeof(ProfileItem), item, false);
267267
if (mq_result == SHM_MQ_DETACHED)
268268
{
269+
hash_seq_term(status);
269270
ereport(WARNING,
270271
(errmsg("pg_wait_sampling collector: "
271272
"receiver of message queue have been detached")));

0 commit comments

Comments
 (0)