edgebitio / enclaver

Open source toolkit created to enable easy adoption of software enclaves
https://edgebit.io/enclaver
Apache License 2.0
124 stars 12 forks source link

Network transmissions can get interrupted on shutdown #167

Closed crawford closed 10 months ago

crawford commented 11 months ago

When the process within an enclave sends a large amount of data over an open socket and then exits, not all of the data will be sent before the enclave exits. From the client's point of view, the response to their request is prematurely terminated. I'm guessing this is because odyn isn't flushing its buffers before exiting, but I haven't had a chance to investigate.

eyakubovich commented 11 months ago

Your theory sounds correct. You can see here that it spawns a next task but doesn't store the handle and therefore doesn't join on exit. And I suppose the tokio runtime does not wait for the tasks to complete on exit.