forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit9d9b9d4
committed
Move cancel key generation to after forking the backend
Move responsibility of generating the cancel key to the backendprocess. The cancel key is now generated after forking, and thebackend advertises it in the ProcSignal array. When a cancel requestarrives, the backend handling it scans the ProcSignal array to findthe target pid and cancel key. This is similar to how this previouslyworked in the EXEC_BACKEND case with the ShmemBackendArray, justreusing the ProcSignal array.One notable change is that we no longer generate cancellation keys fornon-backend processes. We generated them before just to prevent amalicious user from canceling them; the keys for non-backend processeswere never actually given to anyone. There is now an explicit flagindicating whether a process has a valid key or not.I wrote this originally in preparation for supporting longer cancelkeys, but it's a nice cleanup on its own.Reviewed-by: Jelte Fennema-NioDiscussion:https://www.postgresql.org/message-id/508d0505-8b7a-4864-a681-e7e5edfe32aa@iki.fi1 parent19de089 commit9d9b9d4
File tree
12 files changed
+193
-262
lines changed- src
- backend
- postmaster
- storage/ipc
- tcop
- utils/init
- include
- postmaster
- storage
12 files changed
+193
-262
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
71 | 71 |
| |
72 | 72 |
| |
73 | 73 |
| |
74 |
| - | |
| 74 | + | |
75 | 75 |
| |
76 | 76 |
| |
77 | 77 |
| |
|
Lines changed: 4 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
58 | 58 |
| |
59 | 59 |
| |
60 | 60 |
| |
| 61 | + | |
61 | 62 |
| |
62 | 63 |
| |
63 | 64 |
| |
| |||
94 | 95 |
| |
95 | 96 |
| |
96 | 97 |
| |
97 |
| - | |
98 | 98 |
| |
99 | 99 |
| |
100 | 100 |
| |
| |||
104 | 104 |
| |
105 | 105 |
| |
106 | 106 |
| |
107 |
| - | |
108 | 107 |
| |
109 | 108 |
| |
110 | 109 |
| |
| |||
119 | 118 |
| |
120 | 119 |
| |
121 | 120 |
| |
| 121 | + | |
122 | 122 |
| |
123 | 123 |
| |
124 | 124 |
| |
| |||
702 | 702 |
| |
703 | 703 |
| |
704 | 704 |
| |
705 |
| - | |
706 | 705 |
| |
707 | 706 |
| |
708 | 707 |
| |
| |||
712 | 711 |
| |
713 | 712 |
| |
714 | 713 |
| |
715 |
| - | |
716 | 714 |
| |
717 | 715 |
| |
718 | 716 |
| |
| |||
729 | 727 |
| |
730 | 728 |
| |
731 | 729 |
| |
| 730 | + | |
732 | 731 |
| |
733 | 732 |
| |
734 | 733 |
| |
| |||
965 | 964 |
| |
966 | 965 |
| |
967 | 966 |
| |
968 |
| - | |
969 | 967 |
| |
970 | 968 |
| |
971 | 969 |
| |
| |||
975 | 973 |
| |
976 | 974 |
| |
977 | 975 |
| |
978 |
| - | |
979 | 976 |
| |
980 | 977 |
| |
981 | 978 |
| |
| |||
992 | 989 |
| |
993 | 990 |
| |
994 | 991 |
| |
| 992 | + | |
995 | 993 |
| |
996 | 994 |
| |
997 | 995 |
| |
|
0 commit comments
Comments
(0)