Phil Mayers wrote:
I think it's important to note this *will* be working for 2.2.x on Linux because the locking #ifdef will end up using flock() which has saner, per-fd semantics.
I don't recall why that was changed. There was a reason, right?
That said: I don't see why your changes would cause semantic problems here. Since all rlm_sql instances use the logging api, surely they'll all interact just fine with >1 instance writing to the same name?
The problem is that the logging calls are specific to each module. The filenames aren't tracked globally. That could easily be done, but it would have an impact.
I am rather concerned about the locking overhead of the new approach though; my gut feeling tells me a double mutex acquire/release will likely be more expensive than the open()/close() calls, but hopefully I'm wrong.
On Linux, uncontended mutexes can be done in user space. The code *inside* of the mutex is minimal. The only mutex contention will be around opening a new file. That is unavoidable. Alan DeKok.