File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -540,9 +540,16 @@ pg_query_state(PG_FUNCTION_ARGS)
540
540
buffers ,
541
541
triggers ,
542
542
format );
543
- msg = (shm_mq_msg * ) linitial (msgs );
544
543
545
544
funcctx = SRF_FIRSTCALL_INIT ();
545
+ if (list_length (msgs ) == 0 )
546
+ {
547
+ elog (WARNING , "backend does not reply" );
548
+ LockRelease (& tag , ExclusiveLock , false);
549
+ SRF_RETURN_DONE (funcctx );
550
+ }
551
+
552
+ msg = (shm_mq_msg * ) linitial (msgs );
546
553
switch (msg -> result_code )
547
554
{
548
555
case QUERY_NOT_RUNNING :
@@ -946,7 +953,7 @@ GetRemoteBackendQueryStates(List *procs,
946
953
mq_receive_result = shm_mq_receive_with_timeout (mqh ,
947
954
& len ,
948
955
(void * * ) & msg ,
949
- MIN_TIMEOUT );
956
+ 2 * MIN_TIMEOUT );
950
957
if (mq_receive_result != SHM_MQ_SUCCESS )
951
958
/* counterpart is died, not consider it */
952
959
continue ;
You can’t perform that action at this time.
0 commit comments