From ad8a7c379b21d0102c03cda03c661da92a319aaf Mon Sep 17 00:00:00 2001 From: YuQing <384681@qq.com> Date: Fri, 22 Jan 2021 10:13:05 +0800 Subject: [PATCH] log error when idempotency request not finished --- src/idempotency/client/client_channel.c | 6 +++--- src/idempotency/server/server_handler.c | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/idempotency/client/client_channel.c b/src/idempotency/client/client_channel.c index 6d50c65..cf7c0e3 100644 --- a/src/idempotency/client/client_channel.c +++ b/src/idempotency/client/client_channel.c @@ -170,9 +170,9 @@ void client_channel_destroy() { } -struct fast_task_info *alloc_channel_task(IdempotencyClientChannel *channel, - const uint32_t hash_code, const char *server_ip, const uint16_t port, - int *err_no) +static struct fast_task_info *alloc_channel_task(IdempotencyClientChannel + *channel, const uint32_t hash_code, const char *server_ip, + const uint16_t port, int *err_no) { struct fast_task_info *task; diff --git a/src/idempotency/server/server_handler.c b/src/idempotency/server/server_handler.c index 68a338a..2519225 100644 --- a/src/idempotency/server/server_handler.c +++ b/src/idempotency/server/server_handler.c @@ -201,6 +201,9 @@ IdempotencyRequest *sf_server_update_prepare_and_check( *result = idempotency_channel_add_request(channel, request); if (*result == EEXIST) { if (!request->finished) { + response->error.length = sprintf(response->error.message, + "idempotency req id: %"PRId64" exists but NOT " + "finished", request->req_id); *result = EAGAIN; } }