Skip to content

Commit

Permalink
Merge pull request #6105 from citusdata/marcocitus/fix-process-exit
Browse files Browse the repository at this point in the history
Fixes a crash that can happen due to catalog read in shmem_exit
  • Loading branch information
marcocitus authored Jul 29, 2022
2 parents 51a43dc + 6d6e441 commit ccc3b1b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/backend/distributed/connection/shared_connection_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ IncrementSharedConnectionCounter(const char *hostname, int port)
{
SharedConnStatsHashKey connKey;

if (GetMaxSharedPoolSize() == DISABLE_CONNECTION_THROTTLING)
if (MaxSharedPoolSize == DISABLE_CONNECTION_THROTTLING)
{
/* connection throttling disabled */
return;
Expand Down Expand Up @@ -484,7 +484,11 @@ DecrementSharedConnectionCounter(const char *hostname, int port)
{
SharedConnStatsHashKey connKey;

if (GetMaxSharedPoolSize() == DISABLE_CONNECTION_THROTTLING)
/*
* Do not call GetMaxSharedPoolSize() here, since it may read from
* the catalog and we may be in the process exit handler.
*/
if (MaxSharedPoolSize == DISABLE_CONNECTION_THROTTLING)
{
/* connection throttling disabled */
return;
Expand Down

0 comments on commit ccc3b1b

Please sign in to comment.