[PATCH] Add CHECK_FOR_INTERRUPTS in scram_SaltedPassword loop.

Bowen Shi <zxwsbg12138@gmail.com>

From: Bowen Shi <zxwsbg12138@gmail.com>
To: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-11-22T11:47:04Z
Lists: pgsql-hackers

Attachments

Hi, hackers

When the scram_iterations value is set too large, the backend would hang for
a long time.  And we can't use Ctrl+C to cancel this query, cause the loop don't
process signal interrupts.

Add CHECK_FOR_INTERRUPTS within the loop of scram_SaltedPassword
to handle any signals received during this period may be a good choice.

I wrote a patch to solve this problem. What's your suggestions?

Dears
Bowen Shi

Commits

  1. Add CHECK_FOR_INTERRUPTS() in scram_SaltedPassword() for the backend