diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..889b02bd5 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.associations": { + "array": "cpp" + } +} \ No newline at end of file diff --git a/src/endpoint/FaabricEndpointHandler.cpp b/src/endpoint/FaabricEndpointHandler.cpp index fcc00d5b1..63ade2b08 100644 --- a/src/endpoint/FaabricEndpointHandler.cpp +++ b/src/endpoint/FaabricEndpointHandler.cpp @@ -89,8 +89,22 @@ void FaabricEndpointHandler::onRequest( response.result(beast::http::status::ok); response.body() = std::string("Flush sent"); } else { - executeFunction( - std::move(ctx), std::move(response), std::move(msg)); + try + { + executeFunction(std::move(ctx), std::move(response), std::move(msg)); + } + catch (const std::exception& e) + { + SPDLOG_ERROR("Caught exception in FaabricEndpointHandler::onRequest: {}", e.what()); + response.result(beast::http::status::internal_server_error); + response.body() = std::string("Caught exception: ") + e.what(); + ctx.sendFunction(std::move(response)); + } catch (faabric::util::FaabricException& e) { + SPDLOG_ERROR("Caught FaabricException in FaabricEndpointHandler::onRequest: {}", e.what()); + response.result(beast::http::status::internal_server_error); + response.body() = std::string("Caught exception: ") + e.what(); + ctx.sendFunction(std::move(response)); + } return; } } diff --git a/src/scheduler/Scheduler.cpp b/src/scheduler/Scheduler.cpp index 29708b5d2..c5a2aedb8 100644 --- a/src/scheduler/Scheduler.cpp +++ b/src/scheduler/Scheduler.cpp @@ -614,6 +614,8 @@ faabric::util::SchedulingDecision Scheduler::doSchedulingDecision( lastHost = h; // Work out resources on the remote host SPDLOG_DEBUG("Checkig unregeistered {} for resources", h); + SPDLOG_DEBUG("Remaining: {}", remainder); + faabric::HostResources r = getHostResources(h); int available = r.slots() - r.usedslots();