From c2820e99c1e3115a7b1ba0d993eb6b665fa73c17 Mon Sep 17 00:00:00 2001 From: Paul Selkirk Date: Mon, 17 Apr 2017 15:05:38 -0400 Subject: Retry a couple of times on HAL_ERROR_CORE_BUSY. This doesn't guarantee success, but reduces the failure rate on a busy server. --- rpc_server.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/rpc_server.c b/rpc_server.c index d946b06..b28f90c 100644 --- a/rpc_server.c +++ b/rpc_server.c @@ -3,7 +3,7 @@ * ------------ * Remote procedure call server-side private API implementation. * - * Copyright (c) 2016, NORDUnet A/S All rights reserved. + * Copyright (c) 2016-2017, NORDUnet A/S All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -966,7 +966,13 @@ hal_error_t hal_rpc_server_dispatch(const uint8_t * const ibuf, const size_t ile } if (handler) - ret = handler(&iptr, ilimit, &optr, olimit); + for (int i = 0; i < 3; ++i) { + ret = handler(&iptr, ilimit, &optr, olimit); + if (ret != HAL_ERROR_CORE_BUSY) + break; + iptr = ibuf + 4; + optr = obuf + 12; + } else ret = HAL_ERROR_RPC_BAD_FUNCTION; -- cgit v1.2.3