Skip to content

Commit 13e30fa

Browse files
authored
Merge pull request #3974 from clumens/execd-msgs
Low: daemons: Get rid of some logged warnings in execd.
2 parents e39a875 + 558fb8b commit 13e30fa

File tree

3 files changed

+25
-8
lines changed

3 files changed

+25
-8
lines changed

daemons/execd/execd_messages.c

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,22 @@ handle_ipc_fwd_request(pcmk__request_t *request)
5252
return NULL;
5353
}
5454

55-
ipc_proxy_forward_client(request->ipc_client, request->xml);
55+
rc = ipc_proxy_forward_client(request->ipc_client, request->xml);
5656
#else
5757
rc = EPROTONOSUPPORT;
5858
#endif
5959

60+
if (rc == pcmk_rc_ok) {
61+
/* Coverity gets confused by the #ifdef above and thinks this block
62+
* is unreachable due to rc always being EPROTONOSUPPORT.
63+
*/
64+
// coverity[dead_error_line]
65+
pcmk__set_result(&request->result, CRM_EX_OK, PCMK_EXEC_DONE, NULL);
66+
} else {
67+
pcmk__set_result(&request->result, pcmk_rc2exitc(rc), PCMK_EXEC_ERROR,
68+
pcmk_rc_str(rc));
69+
}
70+
6071
pcmk__xe_get_int(request->xml, PCMK__XA_LRMD_CALLID, &call_id);
6172

6273
/* Create a generic reply since forwarding doesn't create a more specific one */
@@ -196,6 +207,8 @@ handle_poke_request(pcmk__request_t *request)
196207

197208
pcmk__xe_get_int(request->xml, PCMK__XA_LRMD_CALLID, &call_id);
198209

210+
pcmk__set_result(&request->result, CRM_EX_OK, PCMK_EXEC_DONE, NULL);
211+
199212
/* Create a generic reply since this doesn't create a more specific one */
200213
reply = execd_create_reply(pcmk_ok, call_id);
201214
return reply;
@@ -297,11 +310,13 @@ handle_rsc_info_request(pcmk__request_t *request)
297310

298311
/* This returns ENODEV if the resource isn't in the cache which will be
299312
* logged as an error. However, this isn't fatal to the client - it may
300-
* querying to see if the resource exists before deciding to register it.
313+
* be querying to see if the resource exists before deciding to register it.
314+
* Thus, we'll ignore an ENODEV to prevent a warning message from being
315+
* logged.
301316
*/
302317
rc = execd_process_get_rsc_info(request->xml, call_id, &reply);
303318

304-
if (rc == pcmk_rc_ok) {
319+
if ((rc == pcmk_rc_ok) || (rc == ENODEV)) {
305320
pcmk__set_result(&request->result, CRM_EX_OK, PCMK_EXEC_DONE, NULL);
306321
} else {
307322
pcmk__set_result(&request->result, pcmk_rc2exitc(rc), PCMK_EXEC_ERROR,

daemons/execd/pacemaker-execd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ void ipc_proxy_init(void);
8888
void ipc_proxy_cleanup(void);
8989
void ipc_proxy_add_provider(pcmk__client_t *client);
9090
void ipc_proxy_remove_provider(pcmk__client_t *client);
91-
void ipc_proxy_forward_client(pcmk__client_t *client, xmlNode *xml);
91+
int ipc_proxy_forward_client(pcmk__client_t *client, xmlNode *xml);
9292
pcmk__client_t *ipc_proxy_get_provider(void);
9393
int ipc_proxy_shutdown_req(pcmk__client_t *ipc_proxy);
9494
void remoted_spawn_pidone(int argc, char **argv);

daemons/execd/remoted_proxy.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ cib_proxy_accept_ro(qb_ipcs_connection_t * c, uid_t uid, gid_t gid)
151151
return ipc_proxy_accept(c, uid, gid, PCMK__SERVER_BASED_RO);
152152
}
153153

154-
void
154+
int
155155
ipc_proxy_forward_client(pcmk__client_t *ipc_proxy, xmlNode *xml)
156156
{
157157
const char *session = pcmk__xe_get(xml, PCMK__XA_LRMD_IPC_SESSION);
@@ -166,12 +166,12 @@ ipc_proxy_forward_client(pcmk__client_t *ipc_proxy, xmlNode *xml)
166166

167167
if (pcmk__str_eq(msg_type, LRMD_IPC_OP_SHUTDOWN_ACK, pcmk__str_casei)) {
168168
handle_shutdown_ack();
169-
return;
169+
return rc;
170170
}
171171

172172
if (pcmk__str_eq(msg_type, LRMD_IPC_OP_SHUTDOWN_NACK, pcmk__str_casei)) {
173173
handle_shutdown_nack();
174-
return;
174+
return rc;
175175
}
176176

177177
ipc_client = pcmk__find_client_by_id(session);
@@ -181,7 +181,7 @@ ipc_proxy_forward_client(pcmk__client_t *ipc_proxy, xmlNode *xml)
181181
pcmk__xe_set(msg, PCMK__XA_LRMD_IPC_SESSION, session);
182182
lrmd_server_send_notify(ipc_proxy, msg);
183183
pcmk__xml_free(msg);
184-
return;
184+
return rc;
185185
}
186186

187187
/* This is an event or response from the ipc provider
@@ -223,6 +223,8 @@ ipc_proxy_forward_client(pcmk__client_t *ipc_proxy, xmlNode *xml)
223223
crm_warn("Could not proxy IPC to client %s: %s " QB_XS " rc=%d",
224224
ipc_client->id, pcmk_rc_str(rc), rc);
225225
}
226+
227+
return rc;
226228
}
227229

228230
static int32_t

0 commit comments

Comments
 (0)