authorize_check_query - authorize_reply_query - synchronous or asynchronous?

Alan DeKok aland at deployingradius.com
Mon Nov 23 13:11:10 CET 2009


freeradius at duxtel.com wrote:
>>   <sigh>  Do you understand how databases work?
> 
> Heheh - uh, yes: I understand how a database works!

  Then there is no issue.

> Perhaps I am missing some significant detail that is obvious to you...(?)  I
> am coming to this discussion with the assumption that the two queries we are
> talking about might be executed synchronously by freeradius:  as in both
> functions are called at the same time, and the radius reply packet is
> constructed from the joint results of both.
> 
> Perhaps this is just a plain dumb idea, but that has been my thinking :-}

  No.  Try running the server in debugging mode.  It runs the queries
SEQUENTIALLY.  Read doc/rlm_sql.  This is documented.

  It runs the reply query ONLY if the results of the check query say
that the reply query should be run.  This is documented.

> I've done a bit (NOT a lot!) of C++ coding in the past, and I'm thinking of
> synchronous (vs asynchronous) functions that can be called essentially
> simultaneously by the core process, and then retrieved a few cycles later
> when the results of those functions have become available.
> 
> If that were the case for freeradius db queries, then it is conceivable that
> the radius reply query could complete before the auth function had finished
> doing it's job.

  I understand.  As I have been trying to say, this is NOT how
FreeRADIUS works.  It is NOT how most applications use SQL, either.

> In fact the way I see it, and the way I have the database queries working at
> the moment, /if/ the radius reply were executed BEFORE the radius auth were
> called, the system would probably work just the same and with no noticeable
> effect on functionality!

  Nonsense.  It would behave *completely* differently.  See the
documentation.

  Alan DeKok.





More information about the Freeradius-Users mailing list