Skip to content

Commit 6b37629

Browse files
committed
kvs: report error to all fence requests
Problem: When an error occurs in a fence request, the error is only reported to the requestor. In most cases, this is fine, but the error should be reported to all members of the fence in some cases. Most notably, it should be reported to all members of the fence when the fence count has been reached and an error has occurred after this point. Solution: In fence_request_cb() return an error via the kvs function error_event_send_to_name() when it is appropriate.
1 parent dc619aa commit 6b37629

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/modules/kvs/kvs.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2046,7 +2046,7 @@ static void fence_request_cb (flux_t *h,
20462046
flux_log_error (h,
20472047
"%s: kvstxn_mgr_add_transaction",
20482048
__FUNCTION__);
2049-
goto error;
2049+
goto error_all;
20502050
}
20512051

20522052
tstat_push (&ctx->txn_fence_stats,
@@ -2077,6 +2077,16 @@ static void fence_request_cb (flux_t *h,
20772077
request_tracking_add (ctx, msg);
20782078
return;
20792079

2080+
error_all:
2081+
/* An error has occurred, so we will return an error similarly to
2082+
* how an error would be returned via a transaction error in
2083+
* kvstxn_apply().
2084+
*/
2085+
if (error_event_send_to_name (ctx, ns, name, errno) < 0)
2086+
flux_log_error (h, "%s: error_event_send_to_name", __FUNCTION__);
2087+
request_tracking_remove (ctx, msg);
2088+
return;
2089+
20802090
error:
20812091
if (flux_respond_error (h, msg, errno, errmsg) < 0)
20822092
flux_log_error (h, "%s: flux_respond_error", __FUNCTION__);

0 commit comments

Comments
 (0)