Bug/Enhancement request: Race condition with short-term accounting (FreeRadius 2.1.10)

Fajar A. Nugraha list at fajar.net
Tue Aug 28 23:55:57 CEST 2012


On Wed, Aug 29, 2012 at 4:11 AM, Alan DeKok <aland at deployingradius.com> wrote:
> Matthias Nagel wrote:

>> 5) Thread #2 terminates first and the accounting stop message is written to the PostgreSQL database. The SQL UPDATE statement fails, because there is no entry for this session that could be updated, as the start message has not been processed yet. Hence, an INSERT INTO statement is executed as a fail-over measure.
>> 6) Thread #1 terminates and an SQL INSERT statement is performed in order to log the start message.
>
>   That doesn't make sense.  If the table indexes are set up correctly,
> the SQL insert will fail at step (6).  The module will then try the
> update query, which should succeed.

IIRC the default schema for postgresql (as was also the case for mysql
untill a month ago) does not have unique index for acctuniqueid. So
yes, by default what the OP experienced will happen, and yes, it's an
easy fix.

-- 
Fajar


More information about the Freeradius-Users mailing list