Red Hat Bugzilla – Bug 1286759
Fix ERR_LIBRARY on finalize call in dispatch
Last modified: 2016-05-10 15:43:01 EDT
Description of problem:
This patch is (hopefully) better version of patch in bug 1141367. Original patch was causing https://github.com/jfriesse/csts/blob/master/tests/start-cfgstop-with-load.sh to fall.
Main problem with original patch was masking error on incorrect place.
If ipc is closed there can still be messages in a buffer (both ipc
socket and shm). Because error in ipc_sem_wait was masked, socket fd
wasn't flushed and pointer in shm data wasn't incremented. If user
application then called dipatch again. old data was read.
This patch uses more steps to handle such behavior:
- Add new error code CS_ERR_IN_SHUTDOWN returned specifically and only
if ipc is closed
- coroipcc_dispatch_get now tests if ipc is closed and if so it
- If ipc_sem_wait in the coroipcc_dispatch_put function returns
CS_ERR_LIBRARY, it's checked if ipc is closed. If so, ipc fd is
flushed and CS_ERR_IN_SHUTDOWN is returned.
- libcfg/confdb/cpg/evs/votequorum tests return code of
coroipcc_dispatch_put. If it returns CS_ERR_IN_SHUTDOWN, error
is masked and function terminated.
Version-Release number of selected component (if applicable):
Depends. On my machines 25% but for example Chrissie was unable to reproduce bug at all.
Steps to Reproduce:
1. Execute https://github.com/jfriesse/csts/blob/master/tests/start-cfgstop-with-load.sh
Test should fall because (at least) one of cpg-load clients dispatches same message more than once.
1. We have to ensure behavior fixed by bug 1141367 is unchanged.
2. Bug is quite low priority (no Z needed) because incorrect behavior happens only on PROPER shutdown of corosync. This is usually not happening (node is ether running or fenced)
Created attachment 1100550 [details]
Revert orig patch
Created attachment 1100551 [details]
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.