cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] libdlm dlm_ls_lock_wait() doesn't.
@ 2008-03-19 22:35 Joel Becker
  2008-03-20 14:39 ` David Teigland
  0 siblings, 1 reply; 4+ messages in thread
From: Joel Becker @ 2008-03-19 22:35 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Folks,
	Another problem I've run into with libdlm - call
dlm_ls_lock_wait() on a lock that another node holds, and it returns
instead of blocking.  This is not a trylock (LKF_NOQUEUE).  Trylocks
work as expected.  A blocking lock attempt does not block, it just
fails.  I haven't had the time to nail it yet, so if you get there
first, excellent.

Joel

-- 

"We'd better get back, `cause it'll be dark soon,
 and they mostly come at night.  Mostly."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Cluster-devel] libdlm dlm_ls_lock_wait() doesn't.
  2008-03-19 22:35 [Cluster-devel] libdlm dlm_ls_lock_wait() doesn't Joel Becker
@ 2008-03-20 14:39 ` David Teigland
  2008-03-20 21:45   ` Joel Becker
  0 siblings, 1 reply; 4+ messages in thread
From: David Teigland @ 2008-03-20 14:39 UTC (permalink / raw)
  To: cluster-devel.redhat.com

On Wed, Mar 19, 2008 at 03:35:11PM -0700, Joel Becker wrote:
> Folks,
> 	Another problem I've run into with libdlm - call
> dlm_ls_lock_wait() on a lock that another node holds, and it returns
> instead of blocking.  This is not a trylock (LKF_NOQUEUE).  Trylocks
> work as expected.  A blocking lock attempt does not block, it just
> fails.  I haven't had the time to nail it yet, so if you get there
> first, excellent.

I've tested both threaded and non-threaded dlm_ls_lock_wait() and they
seem to work for me.  A mistake that I got hung up on for a while was that
a non-threaded program must link against libdlm_lt, not libdlm.

So, a threaded program needs: -D_REENTRANT -lpthread -ldlm
and a non-threaded program needs: -ldlm_lt

Also, in a threaded program, you need to call dlm_ls_pthread_init(handle);
right after creating the lockspace.  I'm not sure what the symptoms would
be if you left out the pthread_init().  The symptoms when I mistakenly
linked my non-threaded program with libdlm were that dlm_ls_lock_wait()
didn't return at all.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Cluster-devel] libdlm dlm_ls_lock_wait() doesn't.
  2008-03-20 14:39 ` David Teigland
@ 2008-03-20 21:45   ` Joel Becker
  2008-03-20 22:20     ` Joel Becker
  0 siblings, 1 reply; 4+ messages in thread
From: Joel Becker @ 2008-03-20 21:45 UTC (permalink / raw)
  To: cluster-devel.redhat.com

On Thu, Mar 20, 2008 at 09:39:02AM -0500, David Teigland wrote:
> On Wed, Mar 19, 2008 at 03:35:11PM -0700, Joel Becker wrote:
> > Folks,
> > 	Another problem I've run into with libdlm - call
> > dlm_ls_lock_wait() on a lock that another node holds, and it returns
> > instead of blocking.  This is not a trylock (LKF_NOQUEUE).  Trylocks
> > work as expected.  A blocking lock attempt does not block, it just
> > fails.  I haven't had the time to nail it yet, so if you get there
> > first, excellent.
> 
> I've tested both threaded and non-threaded dlm_ls_lock_wait() and they
> seem to work for me.  A mistake that I got hung up on for a while was that
> a non-threaded program must link against libdlm_lt, not libdlm.

	libo2dlm is not threaded, so we use libdlm_lt.  I'm getting
EAGAIN returned from dlm_ls_lock_wait() - and this is not a trylock.
I can reproduce with o2dlm_test.  I was about to give you the
instructions on doing so, but I realized it's not trivial - you need the
stack-user kernel modules and to install the tools.

Joel

-- 

"I have never let my schooling interfere with my education."
        - Mark Twain

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Cluster-devel] libdlm dlm_ls_lock_wait() doesn't.
  2008-03-20 21:45   ` Joel Becker
@ 2008-03-20 22:20     ` Joel Becker
  0 siblings, 0 replies; 4+ messages in thread
From: Joel Becker @ 2008-03-20 22:20 UTC (permalink / raw)
  To: cluster-devel.redhat.com

On Thu, Mar 20, 2008 at 02:45:50PM -0700, Joel Becker wrote:
> 	libo2dlm is not threaded, so we use libdlm_lt.  I'm getting
> EAGAIN returned from dlm_ls_lock_wait() - and this is not a trylock.
> I can reproduce with o2dlm_test.  I was about to give you the
> instructions on doing so, but I realized it's not trivial - you need the
> stack-user kernel modules and to install the tools.

	I found the bug, it was in libo2dlm.  There's nothing to see
here.  Move along.

Joel

-- 

"Same dancers in the same old shoes.
 You get too careful with the steps you choose.
 You don't care about winning but you don't want to lose
 After the thrill is gone."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-03-20 22:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-19 22:35 [Cluster-devel] libdlm dlm_ls_lock_wait() doesn't Joel Becker
2008-03-20 14:39 ` David Teigland
2008-03-20 21:45   ` Joel Becker
2008-03-20 22:20     ` Joel Becker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).