Re: Questions about Accepter::stop()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 15 Aug 2016, Willem Jan Withagen wrote:
> > A workaround might be to set a modest timeout (say, 1s) on the poll.  
> > Worst case, you wait up to 1s to shut down, which isn't to bad, and in the 
> > normal case you only wake up needlessly once per second (also not *too* 
> > bad).
> > 
> >> The other solution would be to include a watch pipe in the poll fds.
> >> And then write that pipe if you want to trigger the poll. Instead of
> >> doing the shutdown. I think there is example code for this on the web,
> >> it is called the self-pipe trick.
> > 
> > That's probably the most elegant/correct solution... I'm not sure that teh 
> > current behavior where we call shutdown(2) on an unconnected socket and it 
> > wakes up poll(2) is well-defined behavior.
> 
> I actually found more cases of the selfpipe solution, and it is a
> portable ways of tackling the challenge.
> But there are also more cases that use ::shutdown().
> Which I will have to review and see of they cause the same type of
> errors. But perhaps should we just rewrite all the shutdown cases, just
> to use the same code in all code.

That would be my preference.  Then we're not potentially abusing the API 
and FreeBSD isn't using a different path that isn't as well tested.

Thanks!
sage
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux