Hi Serge,
[resending as lxc-devel rejected my first mail due to its size]
On Wed, Sep 18, 2013 at 11:20 AM, Serge Hallyn <serge.hal...@ubuntu.com>wrote:
> pthread_mutex_lock() will only return an error if it was set to
> PTHREAD_MUTEX_ERRORCHECK and we are recursively calling it (and
> would otherwise have deadlocked). If that's the case then log a
> message for future debugging and exit. Trying to "recover" is
> nonsense at that point.
>
> process_lock() was held over too long a time in lxcapi_start()
> in the daemonize case. (note the non-daemonized case still needs a
> check to enforce that it must NOT be called while threaded). Add
> process_lock() at least across all open/close/socket() calls.
>
> Anything done after a fork() doesn't need the locks as it is no
> longer threaded - so some open/close/dups()s are not locked for
> that reason. However, some common functions are called from both
> threaded and non-threaded contexts. So after doing a fork(), do
> a possibly-extraneous process_unlock() to make sure that, if we
> were forked while pthread mutex was held, we aren't deadlocked by
> nobody.
>
> Tested that lp:~serge-hallyn/+junk/lxc-test still works with this
> patch.
>
> lxc-test-concurrent with this patchset passes almost 100%. I
> occasionally get failures of containers to start (but no task
> corruption) which I've yet to look into. Certainly it seems a
> huge improvement.
>
It is a huge improvement, thanks! I'm observing very same thing that you
described with my test suite. Concurrent creates/stops/shutdowns and
destroys are now %100 passing but some start calls are failing time to time.
Tested-by: S.Çağlar Onur <cag...@10ur.org>
> Signed-off-by: Serge Hallyn <serge.hal...@ubuntu.com>
> ---
> src/lxc/af_unix.c | 15 ++++
> src/lxc/apparmor.c | 11 +++
> src/lxc/attach.c | 35 +++++++++
> src/lxc/bdev.c | 96 +++++++++++++++++++++---
> src/lxc/caps.c | 5 ++
> src/lxc/cgroup.c | 35 +++++++++
> src/lxc/commands.c | 11 +++
> src/lxc/conf.c | 83 +++++++++++++++++++-
> src/lxc/console.c | 72 ++++++++++++------
> src/lxc/freezer.c | 5 ++
> src/lxc/log.c | 7 ++
> src/lxc/lxccontainer.c | 200
> ++++++++++++++++++++++++++++++++-----------------
> src/lxc/lxclock.c | 9 ++-
> src/lxc/lxclock.h | 2 +-
> src/lxc/lxcutmp.c | 11 +++
> src/lxc/mainloop.c | 11 ++-
> src/lxc/monitor.c | 18 ++++-
> src/lxc/network.c | 9 +++
> src/lxc/nl.c | 5 ++
> src/lxc/parse.c | 5 ++
> src/lxc/seccomp.c | 5 ++
> src/lxc/start.c | 31 +++++++-
> src/lxc/state.c | 5 ++
> src/lxc/sync.c | 12 ++-
> src/lxc/utils.c | 52 +++++++++++--
> 25 files changed, 627 insertions(+), 123 deletions(-)
>
Cheers,
--
S.Çağlar Onur <cag...@10ur.org>
------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel