[libqb] [corosync] [LIBQB][PATCH] -ENOTCONN handled as error when client disconnects

Grüninger, Andreas (LGL Extern) Andreas.Grueninger at lgl.bwl.de
Mon Sep 24 17:40:27 UTC 2012


> Are you using git master or 0.14.2 release?
I use git master with the last commit:
...
commit bcba4a298372735787b8f1da58a5d397e6e4e21e
Author: Angus Salkeld <asalkeld at redhat.com>
Date:   Wed Sep 12 10:39:17 2012 +1000
... 

> Does libqb pass make check with this change?
With Solaris the tests with shared memory are disabled, so only the 7 tests are used.

100%: Checks: 9, Failures: 0, Errors: 0
check_ipc.c:822:P:ipc_server_fail_soc:test_ipc_server_fail_soc:0: Passed
check_ipc.c:347:P:ipc_txrx_us_block:test_ipc_txrx_us_block:0: Passed
check_ipc.c:347:P:ipc_txrx_us_tmo:test_ipc_txrx_us_tmo:0: Passed
check_ipc.c:372:P:ipc_fc_us:test_ipc_fc_us:0: Passed
check_ipc.c:413:P:ipc_exit_us:test_ipc_exit_us:0: Passed
check_ipc.c:537:P:ipc_dispatch_us:test_ipc_disp_us:0: Passed
check_ipc.c:636:P:ipc_bulk_events_us:test_ipc_bulk_events_us:0: Passed
check_ipc.c:679:P:ipc_event_on_created_us:test_ipc_event_on_created_us:0: Passed
check_ipc.c:732:P:ipc_disconnect_after_created_us:test_ipc_disconnect_after_created_us:0: Passed
PASS: ipc.test
PASS: resources.test
==================
All 7 tests passed
==================


The errors don't occur when the tests from libqb are used.

I checked several sources from pacemaker with libqb-014.2 (release), libqb-014.1 (release) and libqb-master from github.
These are the versions of pacemaker checked. NOK=with error, OK=without errors
git checkout 1f067dbff3  # 28.06.2012 NOK
get checkout 4789299a6b  # 29.06.2012 NOK
git checkout 010a16b1c8  # 28.05.2012 OK
git checkout db5e16736c  # 30.04.2012 OK
git checkout ee0730e     # 28.03.2012 OK

The errors depend only on the version of pacemaker. Versions between 28.03.2012 and 28.05.2012 work with any version of libqb (with fixes for solaris!
Changes in pacemaker between 28.05.2012 and 29.06.2012 produces the errors.
Please note that the errors are only visible in Solaris/OpenIndiana.

Andreas

-----Ursprüngliche Nachricht-----
Von: quarterback-devel-bounces at lists.fedorahosted.org [mailto:quarterback-devel-bounces at lists.fedorahosted.org] Im Auftrag von Fabio M. Di Nitto
Gesendet: Montag, 24. September 2012 19:22
An: discuss at corosync.org; libqb mailing lst
Betreff: Re: [libqb] [corosync] [LIBQB][PATCH] -ENOTCONN handled as error when client disconnects

On 09/24/2012 05:28 PM, Grüninger, Andreas (LGL Extern) wrote:
> When libqb-0.14.2 (master) is used with pacemaker 1.1.8 (master) the following 2 lines are logged:

Are you using git master or 0.14.2 release?

Does libqb pass make check with this change?

We did a big amount of work on libqb/corosync portability in the last
2/3 weeks and this didn't appear to be a problem with git master.

Can you please confirm what you are using?


> Sep 21 23:17:27 [19442]        cib:    error: _process_request_:        recv from client connection failed (19442-19447-12): Error 0 (0)
> Sep 21 23:17:27 [19442]        cib:    error: qb_ipcs_dispatch_connection_request:      request returned error (19442-19447-12): Transport endpoint is not connected (134)
> 
> In Solaris/OpenIndiana qb_ipc_us_recv_at_most returns -ENOTCONN when a client disconnects.
> _process_request_ and qb_ipcs_dispatch_connection_request don't know this and log the 2 errors.
> With this patch the logging is suppressed.
> 
> 
> diff --git a/lib/ipcs.c b/lib/ipcs.c
> index 0fa7142..ac9c9fa 100644
> --- a/lib/ipcs.c
> +++ b/lib/ipcs.c
> @@ -627,7 +627,8 @@ _process_request_(struct qb_ipcs_connection *c, int32_t ms_timeout)
>                                               ms_timeout);
>         }
>         if (size < 0) {
> -               if (size != -EAGAIN && size != -ETIMEDOUT) {
> +                if (size == -ENOTCONN) {
> +               } else if (size != -EAGAIN && size != -ETIMEDOUT) {
>                         qb_util_perror(LOG_ERR,
>                                        "recv from client connection failed (%s)",
>                                        c->description); @@ -774,13 
> +775,16 @@ qb_ipcs_dispatch_connection_request(int32_t fd, int32_t revents, void *data)
>         res = QB_MIN(0, res);
>         if (res == -EAGAIN || res == -ETIMEDOUT || res == -ENOBUFS) {
>                 res = 0;
> -       }
> -       if (res != 0) {
> +        } else if (res == -ENOTCONN) {
> +             errno = -res;
> +             qb_ipcs_disconnect(c);
> +             res = -ESHUTDOWN;
> +        } else if (res != 0) {
>                 errno = -res;
>                 qb_util_perror(LOG_ERR, "request returned error (%s)",
>                                c->description);
>                 qb_ipcs_connection_unref(c);
> -       }
> +       }
> 
>         return res;
>  }
> 
> _______________________________________________
> discuss mailing list
> discuss at corosync.org
> http://lists.corosync.org/mailman/listinfo/discuss
> 

_______________________________________________
quarterback-devel mailing list
quarterback-devel at lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/quarterback-devel


More information about the quarterback-devel mailing list