<div dir="ltr">Thanks for this, Tim! Really happy to see that old fslock code go away, and using much more reliable OS-level functionality.</div><br><div class="gmail_quote"><div dir="ltr">On Tue, Jun 21, 2016 at 11:53 AM Alexis Bruemmer <<a href="mailto:alexis.bruemmer@canonical.com">alexis.bruemmer@canonical.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Tim this is really awesome and will address a few long standing and painful field bugs. Thank you for taking the extra effort to do this work!<div><br></div><div>Also thank you to Nate Finch and David Cheney for their contributions on this effort.</div></div><div class="gmail_extra"></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 21, 2016 at 2:24 AM, Tim Penhey <span dir="ltr"><<a href="mailto:tim.penhey@canonical.com" target="_blank">tim.penhey@canonical.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi folks,<br>
<br>
We have finally managed to exorcise the fslock from the codebase. Both 1.25 and master no longer refer to it at all. We need to remove it from the juju/utils package to make sure that people don't accidentally try and use it again.<br>
<br>
There is a new replacement, the juju/mutex package. To acquire a mutex, you create a mutex.Spec structure. You must at least provide a name, delay and clock. The delay is how long the code waits between tries to acquire the mutex. Named mutexs are shared between processes on the same machine. If a process holds the mutex and the process dies, the mutex is automatically released. A spec can also have a timeout value, and/or an abort channel.<br>
<br>
On linux this is implemented with abstract domain sockets, on windows it uses a named semaphore, and on other platforms a flock is used on a named temp file.<br>
<br>
<a href="https://godoc.org/github.com/juju/mutex" rel="noreferrer" target="_blank">https://godoc.org/github.com/juju/mutex</a><br>
<br>
Cheers,<br>
Tim<span><font color="#888888"><br>
<br>
-- <br>
Juju-dev mailing list<br>
<a href="mailto:Juju-dev@lists.ubuntu.com" target="_blank">Juju-dev@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/juju-dev" rel="noreferrer" target="_blank">https://lists.ubuntu.com/mailman/listinfo/juju-dev</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div></div><div class="gmail_extra">-- <br><div data-smartmail="gmail_signature"><div dir="ltr">Alexis Bruemmer<div>Juju Core Manager, Canonical Ltd.</div><div>(503) 686-5018</div><div><a href="mailto:alexis.bruemmer@canonical.com" target="_blank">alexis.bruemmer@canonical.com</a></div></div></div>
</div>
--<br>
Juju-dev mailing list<br>
<a href="mailto:Juju-dev@lists.ubuntu.com" target="_blank">Juju-dev@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/juju-dev" rel="noreferrer" target="_blank">https://lists.ubuntu.com/mailman/listinfo/juju-dev</a><br>
</blockquote></div>