Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sessions terminated using kill command still leave behind entries in dm_exec_sessions #3350

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions contrib/babelfishpg_tds/src/backend/tds/tds.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,19 +441,17 @@ tds_status_shmem_startup(void)
static void
tds_stats_shmem_shutdown(int code, Datum arg)
{
/* Don't try to save the outlines during a crash. */
if (code)
return;
volatile TdsStatus *myTdsStatusEntry = MyTdsStatusEntry;

/* Safety check ... shouldn't get here unless shmem is set up. */
if (TdsStatusArray == NULL || MyTdsStatusEntry == NULL)
return;

PGSTAT_BEGIN_WRITE_ACTIVITY(MyTdsStatusEntry);
PGSTAT_BEGIN_WRITE_ACTIVITY(myTdsStatusEntry);

MyTdsStatusEntry->st_procpid = 0; /* mark invalid */
myTdsStatusEntry->st_procpid = 0; /* mark invalid */

PGSTAT_END_WRITE_ACTIVITY(MyTdsStatusEntry);
PGSTAT_END_WRITE_ACTIVITY(myTdsStatusEntry);

MyTdsStatusEntry = NULL;

Expand Down