Hello Ivan,

Would adding a mutex around the select-update code in the sqlippool module solve this issue?

Padam

t...@kalik.net wrote:
The requests all came in at the same time, to the second (among others),
its like FR took 3 requests and looked at the database at the exact same
time, saw it was an available IP and all those 3 requests assigned it.
    

That can't be avoided. SELECT (allocate-find) will always work much
faster than UPDATE (allocate-update).

  
My NAS rejects two of the 3 because the IP is assigned,
    

I think that you make a good point here. If the allocate-update query was
made to fail in the case that the IP address was already issued to
another thread between allocate-find and allocate-update (by expanding
it with AND expiry_time IS NULL in WHERE), point of failure will be in
sqlippool module and not on the NAS. Logic can then perhaps try to issue
a new IP address (best just once more in order not to create a loop).
That way issuing same IP address to multiple threads can be handled by
the sqlippool module.

Ivan Kalik
Kalik Informatika ISP

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

  

-- 
PGP Id 9EED2E09
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to