Bug#983405: concurrency

2022-06-29 Thread Marc Haber
On Wed, Jun 29, 2022 at 07:32:42AM -0400, Matt Barry wrote: > On Wed, 2022-06-29 at 11:13 +0200, Marc Haber wrote: > > On Tue, Jun 28, 2022 at 01:34:23PM -0400, Matt Barry wrote: > > > Good call.  I've attached a minimal POC, which works in manual > > > testing, > > > but automated testing is

Bug#983405: concurrency

2022-06-29 Thread Matt Barry
On Wed, 2022-06-29 at 11:13 +0200, Marc Haber wrote: > On Tue, Jun 28, 2022 at 01:34:23PM -0400, Matt Barry wrote: > > Good call.  I've attached a minimal POC, which works in manual > > testing, > > but automated testing is tricky and there may be edge cases.  (This > > test is blocking; NB

Bug#983405: concurrency

2022-06-29 Thread Marc Haber
On Tue, Jun 28, 2022 at 01:34:23PM -0400, Matt Barry wrote: > Good call. I've attached a minimal POC, which works in manual testing, > but automated testing is tricky and there may be edge cases. (This > test is blocking; NB (erroring out) might be easier to test, but which > is the better UX?)

Bug#983405: concurrency

2022-06-28 Thread Matt Barry
tags -1 patch On Mon, 2022-06-27 at 22:02 +0200, Marc Haber wrote: > > /run/adduser please, and probably a simple flock()? lock files in a > shell script are a minefield for code running as root, I hope it is > easier in perl. Good call. I've attached a minimal POC, which works in manual

Bug#983405: concurrency

2022-06-27 Thread Marc Haber
On Mon, Jun 27, 2022 at 11:20:45AM -0400, Matt Barry wrote: > The simplest way I can think of to solve this is: > > (start) > mkdir /tmp/adduser.lock > sleep and loop until mkdir succeeds > > (end) > remove /tmp/adduser.lock > > which should be atomic assuming a local /tmp. >

Bug#983405: concurrency

2022-06-27 Thread Matt Barry
The simplest way I can think of to solve this is: (start) mkdir /tmp/adduser.lock sleep and loop until mkdir succeeds (end) remove /tmp/adduser.lock which should be atomic assuming a local /tmp. One could possibly add a /tmp/adduser.lock/adduser.pid and check for a dead