On Tue, Mar 08, 2016 at 10:18:46AM -0500, Simo Sorce wrote:
Fixing everything else commented before.
On Sat, 2016-03-05 at 15:31 +0100, Jakub Hrozek wrote:
> And this is the question. The new code doesn't restore the flags, is
> this an intentional change? Do you know why we restored the flags
> previously?
Yes, it is an intentional change as restoring the flags was not needed.
What happens if the function fails is that we are going to close the
socket anyway, so what's the point of restoring flags (which means
removing O_NONBLOCK in the end, somethign we never want to do as all
sockets must be non-blocking in SSSD to avoig hangs.
Fixed patches attacched.
Simo.
--
Simo Sorce * Red Hat, Inc * New York
From 5551dc918890cf445cadb1b39c42d9a6dffa8bb8 Mon Sep 17 00:00:00
2001
From: Simo Sorce <simo(a)redhat.com>
Date: Wed, 2 Mar 2016 15:49:27 -0500
Subject: [PATCH 2/3] Util: Set socket options and flags separately
Reorganize functions to set options and flags, all flags can be set at once,
and there is no need to keep old falgs around as nothing ever used that for
anything useful.
Related:
https://fedorahosted.org/sssd/ticket/2968
This patch breaks failover for me. I can't really figure out why, the
code looks OK, though.
What I'm seeing is that the connect() call blocks. If I just add another
SETFD with O_NONBLOCK, everything works fine.
I really don't see the error though, can you? I can reliably reproduce
the error with:
- search for a user to establish connection
- pause the VM with the server
- search again