MCPcopy Create free account
hub / github.com/apache/cloudberry / die

Function die

src/backend/tcop/postgres.c:3792–3820  ·  view source on GitHub ↗

* Shutdown signal from postmaster: abort transaction and exit * at soonest convenient time */

Source from the content-addressed store, hash-verified

3790 * at soonest convenient time
3791 */
3792void
3793die(SIGNAL_ARGS)
3794{
3795 int save_errno = errno;
3796
3797 /* Don't joggle the elbow of proc_exit */
3798 if (!proc_exit_inprogress)
3799 {
3800 InterruptPending = true;
3801 ProcDiePending = true;
3802 }
3803
3804 /* for the statistics collector */
3805 pgStatSessionEndCause = DISCONNECT_KILLED;
3806
3807 /* If we're still here, waken anything waiting on the process latch */
3808 SetLatch(MyLatch);
3809
3810 /*
3811 * If we're in single user mode, we want to quit immediately - we can't
3812 * rely on latches as they wouldn't work when stdin/stdout is a file.
3813 * Rather ugly, but it's unlikely to be worthwhile to invest much more
3814 * effort just for the benefit of single user mode.
3815 */
3816 if (DoingCommandRead && whereToSendOutput != DestRemote)
3817 ProcessInterrupts(__FILE__, __LINE__);
3818
3819 errno = save_errno;
3820}
3821
3822/*
3823 * Query-cancel signal from postmaster: abort current transaction

Callers 6

terminate_processFunction · 0.85
test_openFunction · 0.85
test_syncFunction · 0.85
test_open_syncFunction · 0.85
test_non_syncFunction · 0.85

Calls 2

SetLatchFunction · 0.85
ProcessInterruptsFunction · 0.85

Tested by 6

terminate_processFunction · 0.68
test_openFunction · 0.68
test_syncFunction · 0.68
test_open_syncFunction · 0.68
test_non_syncFunction · 0.68