All of lore.kernel.org
 help / color / mirror / Atom feed
* What really happens when a connection race happens?
@ 2016-12-25 10:31 xxhdx1985126
  2017-01-04  2:29 ` Gregory Farnum
  0 siblings, 1 reply; 2+ messages in thread
From: xxhdx1985126 @ 2016-12-25 10:31 UTC (permalink / raw)
  To: ceph-devel

Hi, everyone.

I'm reading the source code of Pipe in ceph, and I'm confused about the code for connection race processing. Suppose that the policy the two Pipe involved is lossless_peer, one of them wins and send the other pipe a CEPH_MSGR_TAG_WAIT message which makes the other Pipe's writer to cond.wait(), and then the winning pipe goes back to waiting for a ceph_msg_connect message to come. But, under this circumstance, the writer of the other pipe is waiting, and as far as I know,  unless something happens it will never send ceph_msg_connect messages, so they will wait for each other for ever........  There must be some misunderstanding here, but I don't know where, please help me. Thank you:-)

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

* Re: What really happens when a connection race happens?
  2016-12-25 10:31 What really happens when a connection race happens? xxhdx1985126
@ 2017-01-04  2:29 ` Gregory Farnum
  0 siblings, 0 replies; 2+ messages in thread
From: Gregory Farnum @ 2017-01-04  2:29 UTC (permalink / raw)
  To: xxhdx1985126; +Cc: ceph-devel

On Sun, Dec 25, 2016 at 2:31 AM, xxhdx1985126 <xxhdx1985126@163.com> wrote:
> Hi, everyone.
>
> I'm reading the source code of Pipe in ceph, and I'm confused about the code for connection race processing. Suppose that the policy the two Pipe involved is lossless_peer, one of them wins and send the other pipe a CEPH_MSGR_TAG_WAIT message which makes the other Pipe's writer to cond.wait(), and then the winning pipe goes back to waiting for a ceph_msg_connect message to come. But, under this circumstance, the writer of the other pipe is waiting, and as far as I know,  unless something happens it will never send ceph_msg_connect messages, so they will wait for each other for ever........  There must be some misunderstanding here, but I don't know where, please help me. Thank you:-)

The point is that we have racing connect attempts here — the "winner"
has already sent out a connection attempt which the loser will respond
to. So neither of them needs to do anything; when the loser processes
the winner's connection attempt, it will shut down its losing Pipe,
start up a Pipe with the incoming attempt, and send back an
acknowledgement to the winner.
-Greg

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

end of thread, other threads:[~2017-01-04  2:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-25 10:31 What really happens when a connection race happens? xxhdx1985126
2017-01-04  2:29 ` Gregory Farnum

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.