Check for interrupts in bf and xdes crypt() - Mailing list pgsql-hackers

From Andreas Karlsson
Subject Check for interrupts in bf and xdes crypt()
Date
Msg-id 566FD0DD.4020303@proxel.se
Whole thread Raw
Responses Re: Check for interrupts in bf and xdes crypt()
List pgsql-hackers
Hi,

Here is a patch which makes it possible to cancel a query which runs the
crypt() function with the bf or xdes hashing algorithm, e.g.
crypt('foo', gen_salt('bf', 13)). The md5 algorithm does not run for
multiple rounds so there is no reason to patch it.

I noticed this problem when I accidentally picked a too high n for the
number of hash rounds.

I have added a call to CHECK_FOR_INTERRUPTS() after every round, and I
could not measure any performance hit from this.

Andreas

Attachment

pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Unused(?) field Form_pg_sequence.sequence_name, not updated by seq rename
Next
From: Fabien COELHO
Date:
Subject: Re: pgbench stats per script & other stuff