Re: On login trigger: take three
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Greg Nancarrow <gregn4422@gmail.com>
Cc: Daniel Gustafsson <daniel@yesql.se>, Ivan Panchenko <wao@mail.ru>,
Teodor Sigaev <teodor@sigaev.ru>, Ibrar Ahmed <ibrar.ahmad@gmail.com>, vignesh C <vignesh21@gmail.com>, Pavel Stehule <pavel.stehule@gmail.com>,
PostgreSQL Hackers <pgsql-hackers@postgresql.org>, Amit Kapila <amit.kapila16@gmail.com>,
Masahiko Sawada <sawada.mshk@gmail.com>
Date: 2022-03-11T21:10:36Z
Lists: pgsql-hackers
On Tue, Feb 15, 2022 at 5:07 AM Greg Nancarrow <gregn4422@gmail.com> wrote: > I've attached a re-based version (no functional changes from the > previous) to fix cfbot failures. I tried this: rhaas=# create function on_login_proc() returns event_trigger as $$begin perform pg_sleep(10000000); end$$ language plpgsql; CREATE FUNCTION rhaas=# create event trigger on_login_trigger on login execute procedure on_login_proc(); When I then attempt to connect via psql, it hangs, as expected. When I press ^C, psql exits, but the backend process is not cancelled and just keeps chugging along in the background. The good news is that if I connect to another database, I can cancel all of the hung sessions using pg_cancel_backend(), and all of those processes then promptly exit, and presumably I could accomplish the same thing by sending them SIGINT directly. But it's still not great behavior. It would be easy to use up a pile of connection slots inadvertently and have to go to some trouble to get access to the server again. Since this is a psql behavior and not a server behavior, one could argue that it's unrelated to this patch, but in practice this patch seems to increase the chances of people running into problems quite a lot. -- Robert Haas EDB: http://www.enterprisedb.com
Commits
-
Fix some typos in event trigger docs
- 5fce30e77fe1 17.0 landed
-
Use heap_inplace_update() to unset pg_database.dathasloginevt
- 8be93177c46b 17.0 landed
-
Remove the flaky check in event_trigger_login regression test
- 4b885d01f967 17.0 landed
-
Fix instable 006_login_trigger.pl test
- 06be01eb266b 17.0 landed
-
Add support event triggers on authenticated login
- e83d1b0c40cc 17.0 landed
-
Add GUC for temporarily disabling event triggers
- 7750fefdb2b8 17.0 landed
-
Fix typo in reference to __FreeBSD__.
- e52f8b301ed5 16.0 cited
-
Restore robustness of TAP tests that wait for postmaster restart.
- f452aaf7d4a9 14.0 cited
-
Restore the portal-level snapshot after procedure COMMIT/ROLLBACK.
- 84f5c2908dad 14.0 cited