* log: lower IPC connection issues to info level
... in handle_new_connection(). The caller has better context for whether a
problem merits a warning or error, and the function's return code is
sufficiently descriptive to do so. Some problems may be expected or able to be
worked around.
For example, Pacemaker's crm_mon attempts to contact pacemakerd IPC. On a
Pacemaker Remote node, that IPC will be unavailable, and crm_mon can check the
libqb return code to detect and handle that situation gracefully.
* log: lower some ringbuffer debug messages to trace level
They're rather noisy, with every shm-based IPC connection generating multiple
obscure messages like:
debug: shm size:1048589; real_size:1052672; rb->word_size:263168
and every disconnect generating the rather unhelpful:
debug: qb_ipcc_disconnect()
along with multiple messages like:
debug: Closing ringbuffer: /dev/shm/qb-10986-11014-34-26VRvs/qb-request-cmap-header
All of these seem appropriate to trace level.
* ipc: addd qb_ipcc_auth_get() API call
We can't use SO_PEERCRED on the client fd when using socket IPC
becayse it's a DGRAM socket (pacemaker tries this). So provide
an API to get the server credentials that libqb has already
squirreled away for its own purposes.
Also, fix some unused-variable compiler warnings in unix.c
when building on systems without posix_fallocate().
* Fix typo: p{rr -> r}ocess
* doc: qbrb.h: several fixes to punctuation
* doc: qbrb.h: reindent example writer's error label as per reader
* doc: qbhdb.h: explain former importance to libqb itself
* doc: ipcc.c: explain why client would timebox recv from server
Also refer to commit d633b4e.
* doc: qblog.h: minor stylistic/doxygen markup cosmetics
* doc: qblog.h: note qb_log_format_set vs. fork interaction wrt. PIDs
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
When server side buffer limits are in use, this is
necessary to determine the buffer size the server
is enforcing after the client connection is established.
It seems like poll() was not producing a POLLHUP
so we rely on qb_ipc_us_recv() returning -ENOTCONN.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Move the connection type into the one_way struct. Seem
like a more obvious place for it next to the union.
Also it will help prevent issues like in qb_ipc_us_recv()
where there is a rather dodgy access of ctl->sent.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
This is because semaphores can't detect the other side has
failed/exited. So we rely on the socket poll to tell us.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
My receint change adding in a call to recv_ready(, 10) was
really slowing down the shm performance.
So now I am rather retrying which doesn't slow it down
and also passes "make check".
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>