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

Phil Mayers p.mayers at imperial.ac.uk
Wed Aug 29 10:24:17 CEST 2012


On 08/28/2012 05:26 PM, Matthias Nagel wrote:

> is incomplete, i.e. it only has as start time. The latter never will
> be completed, because the stop message has already been processed and
> acknowledged to the authenticator.

Aside from anything else - you need to handle this case. Accounting is 
UDP-based and might be dropped, even with retries.

We use an SQL query to "expire" accounting sessions which haven't been 
updated in 2 hours. Since our maximum interim-accounting interval is 30 
minutes, that covers most cases.

e.g.

update radacct set acctstoptime=now()
where
now() - acctstarttime + (coalesce(acctsessiontime,0)||' 
seconds')::interval > '2 hours'

If your NAS generates truly unique acctsessionid values, even across 
reboots (some do) maybe you can modify the SQL to handle this case, for 
example by setting a unique index on that column.


More information about the Freeradius-Users mailing list