Subject: | EXLOCK should default to false |
Currently EXLOCK defaults to true, which may be suprising for File::Temp users developing on non-BSD platforms (where EXLOCK=>1 does nothing), and encounter unexpected failures when running on BSD systems (where EXLOCK=>1 sets a lock, and if the temporary file is used by a component also setting a lock (e.g. sqlite) then things fail or even hang). In the past I created numerous bug reports against various CPAN modules because of this --- here's a small excerpt:
* https://rt.cpan.org/Ticket/Display.html?id=122766
* https://rt.cpan.org/Ticket/Display.html?id=120419
* https://rt.cpan.org/Ticket/Display.html?id=117875
* https://rt.cpan.org/Ticket/Display.html?id=76415
* https://rt.cpan.org/Ticket/Display.html?id=76418
Actually I don't see the benefits of EXLOCK here. Is it for extra security? It's about non-mandatory locking, so there's no security benefit (and if, what about non-BSD systems?). Is it about being able to set a lock in an atomic way? But temporary files are unique, so one does not have to deal with concurrent access. Is there a use case for EXLOCK here?
My suggestion is to change the default to EXLOCK=>0. I don't expect any breakages on CPAN and elsewhere, just contrary --- CPAN modules which are broken on BSD systems would work again.
Regards,
Slaven