Re: Cancel/Kill backend functions
От | Magnus Hagander |
---|---|
Тема | Re: Cancel/Kill backend functions |
Дата | |
Msg-id | 6BCB9D8A16AC4241919521715F4D8BCE34BB4B@algol.sollentuna.se обсуждение исходный текст |
Ответ на | Cancel/Kill backend functions ("Magnus Hagander" <mha@sollentuna.net>) |
Ответы |
Re: Cancel/Kill backend functions
|
Список | pgsql-patches |
>> >> Okay, here is an updated patch. now uses IsBackendPid(), which is >> >> closely modeled (read cut-and-pasted) from >> >> TransactionIdIsInProgress(). > >I wonder what can happen if a backend passes the >IsBackendPid() test and >terminates just before the kill() signal? It should be pretty unlikely >but you could signal the wrong process ... shouldn't the SInvalLock be >held throughout the whole operation? You'd actually need to get a pid *reuse* during that short time. Otherwise, you're just kill():ing a nonexistant process, which should be no problem. This is the same as issuing a "kill -INT <pid>" from the shell after doing ps(1), which is basically what this function tries to emulate. Should be no more dangerous than that. Bottom line - while maybe slightly more correcet, not sure it's necessary. //Magnus
В списке pgsql-patches по дате отправления: