Unverified Commit ddb89c83 authored by Stan Kladko's avatar Stan Kladko Committed by GitHub

Merge pull request #179 from skalenetwork/SKALE-3274

SKALE-3274-restart-enclave
parents b676e9f8 8733da4c
...@@ -210,7 +210,6 @@ void gen_SEK() { ...@@ -210,7 +210,6 @@ void gen_SEK() {
} }
void reinitEnclave() { void reinitEnclave() {
WRITE_LOCK(initMutex);
// unfortunately process needs to be restarted to reinit enclave // unfortunately process needs to be restarted to reinit enclave
// exiting with error code 3 (SGX_OUT_OF_MEMORY), so docker container can restart the // exiting with error code 3 (SGX_OUT_OF_MEMORY), so docker container can restart the
// wallet // wallet
......
...@@ -119,23 +119,23 @@ READ_LOCK(initMutex); ...@@ -119,23 +119,23 @@ READ_LOCK(initMutex);
#define RESTART_END \ #define RESTART_END \
} \ } \
if (status != SGX_SUCCESS || errStatus != 0) { \ if (status != SGX_SUCCESS || errStatus == 3) { \
spdlog::error(__FUNCTION__); \ spdlog::error(__FUNCTION__); \
spdlog::error("Restarting sgx on status errStatus... {} {}", status, errStatus); \ spdlog::error("Restarting sgx on status errStatus... {} {}", status, errStatus); \
reinitEnclave(); \ reinitEnclave(); \
} \ } \
} while ((status != SGX_SUCCESS || errStatus != 0) && __ATTEMPTS__ < 2); } while ((status != SGX_SUCCESS || errStatus == 3) && __ATTEMPTS__ < 2);
#define RESTART_END_POINTER \ #define RESTART_END_POINTER \
} \ } \
if (status != SGX_SUCCESS || *errStatus != 0) { \ if (status != SGX_SUCCESS || *errStatus == 3) { \
spdlog::error(__FUNCTION__);\ spdlog::error(__FUNCTION__);\
spdlog::error("Restarting sgx on status errStatus... {} {}", status, *errStatus); \ spdlog::error("Restarting sgx on status errStatus... {} {}", status, *errStatus); \
reinitEnclave(); \ reinitEnclave(); \
} \ } \
} while ((status != SGX_SUCCESS || *errStatus != 0) && __ATTEMPTS__ < 2); } while ((status != SGX_SUCCESS || *errStatus == 3) && __ATTEMPTS__ < 2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment