From 287dc63c60a52d7bf66e5741fec5e2b808bb03ea Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Tue, 20 Feb 2024 15:04:38 -0500 Subject: [PATCH] Only reset error if a previous error was set. --- src/main/aerospike/aerospike.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/aerospike/aerospike.c b/src/main/aerospike/aerospike.c index 5e37a3dad..0017ba932 100644 --- a/src/main/aerospike/aerospike.c +++ b/src/main/aerospike/aerospike.c @@ -253,10 +253,11 @@ aerospike_close(aerospike* as, as_error* err) if (cluster) { if (cluster->metrics_enabled) { as_status status = aerospike_disable_metrics(as, err); + if (status != AEROSPIKE_OK) { as_log_warn("Metrics error: %s %s", as_error_string(status), err->message); + as_error_reset(err); } - as_error_reset(err); } if (as_event_loop_size > 0 && !as_event_single_thread) {