Skip to content
Snippets Groups Projects
Commit 829b9529 authored by Florian Schmaus's avatar Florian Schmaus
Browse files

Merge branch 'io-context-error-handling' into 'master'

[IoContext] Add missing error handling in submitPreparedSqesAndWait()

See merge request i4/manycore/emper!235
parents a7a20376 3c8c24a7
No related branches found
No related tags found
No related merge requests found
......@@ -107,12 +107,7 @@ auto IoContext::submitPreparedSqesAndWait(unsigned wait_nr) -> unsigned {
int submitted = io_uring_submit_and_wait(&ring, wait_nr);
// Actually I don't know how "unlikely" this is
if (unlikely(submitted < 0)) {
if (unlikely(submitted != -EBUSY)) {
errno = -submitted;
DIE_MSG_ERRNO("io_uring_submit failed");
}
if (unlikely(submitted == -EBUSY)) {
// We can't submit our sqe because the CQ is full
// in worker thread -> reapCompletions
// in globalCompleter thread -> TODO: deterministically handle global full CQ
......@@ -134,6 +129,11 @@ auto IoContext::submitPreparedSqesAndWait(unsigned wait_nr) -> unsigned {
stats.record_io_submit_full_cq);
}
if (unlikely(submitted < 0)) {
errno = -submitted;
DIE_MSG_ERRNO("io_uring_submit failed");
}
return static_cast<unsigned>(submitted);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment