Skip to content

Commit

Permalink
redfishpower: lower message timeout
Browse files Browse the repository at this point in the history
Problem: The libcurl message timeout defaults to 10 seconds, which is
quite long for the typical "timeouts" that can occur on a large cluster,
such as a name lookup failure or connection timeout.

Lower the default from 10 seconds to 5 seconds.
  • Loading branch information
chu11 committed Apr 30, 2024
1 parent 39673eb commit 97449c5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/redfishpower/redfishpower.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static hostlist_t test_fail_power_cmd_hosts;
static zhashx_t *test_power_status;

/* in seconds */
#define MESSAGE_TIMEOUT 10
#define MESSAGE_TIMEOUT 5
#define CMD_TIMEOUT_DEFAULT 60

/* Per documentation, wait incremental time then proceed if timeout < 0 */
Expand Down Expand Up @@ -268,6 +268,8 @@ static void powermsg_init_curl(struct powermsg *pm)
if ((pm->eh = curl_easy_init()) == NULL)
err_exit(false, "curl_easy_init failed");

/* Per documentation, CURLOPT_TIMEOUT overrides
* CURLOPT_CONNECTTIMEOUT */
Curl_easy_setopt((pm->eh, CURLOPT_TIMEOUT, MESSAGE_TIMEOUT));
Curl_easy_setopt((pm->eh, CURLOPT_FAILONERROR, 1));

Expand Down

0 comments on commit 97449c5

Please sign in to comment.