Closed brooksmtownsend closed 1 year ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this has been closed too eagerly, please feel free to tag a maintainer so we can keep working on the issue. Thank you for contributing to wasmCloud!
Describe the bug
When we receive control interface requests, we use the built-in mechanism
{:reply, msg}
to reply to that request. If a NATS server were to go down in the middle of handling a request, the host supervision tree would crash and burn when trying toGnat.pub
on the way out.We should use the
HostCore.Nats.safe_pub
function to publish the reply out on the control connection. Each usage of the{:reply, msg}
tuple in host_server and lattice_server should use the safe_pub function instead, and the final line of the function should instead be:ok
so that Gnat doesn't send a reply on its own.To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expect the host to be able to handle intermittent NATS connections, and if NATS goes down in the middle of handling a request then the host should be resilient and simply fail to publish the reply.