fault/fm-common
Takamasa Takenaka 8bd6e5b92d Validate fm manager socket fd before send a message
When fm manager is restarted, there is no mechanism to detect it
from fm api client side. As a result, when subcloud delete clear
alarm request is sent after fm manager is restarted, fm api client
will show broke pipe and clear alarm request is not received and
this alarm stays.

This fix is to check socket fd state before send/receive from
fm api client. If broken pipe is detected, it will try to
reconnect to fm manager.

Closes-bug: 2039684

Test Plan:
PASS: Restart fm manager and confirm that detect broken pipe
      and reconnect messages in /var/log. For example,
-----
sm: err fmSocket.cpp(270): A broken pipe error occurred
sm: warning fmAPI.cpp(116): Invalid file descriptor. Atte
mpting to reconnect...
sm: info fmAPI.cpp(149): Connected to FM Manager.
-----
PASS: Delete offline subcloud and confirm the alarm is
      removed.

Change-Id: Ibc0f4d96b5c0a385d8fedbc1acd23898f1cbea46
Signed-off-by: Takamasa Takenaka <takamasa.takenaka@windriver.com>
2023-10-19 15:18:17 -03:00
..
centos Reimplementation logic for trap generation 2020-12-08 18:37:50 -03:00
debian Update debian package versions to use git commits 2023-02-09 18:06:57 +00:00
opensuse Delete _service files from git. 2019-09-30 13:27:21 -05:00
sources Validate fm manager socket fd before send a message 2023-10-19 15:18:17 -03:00
.gitignore StarlingX open source release updates 2018-05-31 07:36:00 -07:00
PKG-INFO StarlingX open source release updates 2018-05-31 07:36:00 -07:00