Home / Function/ processCompletionsAndHandleOverflow() — netty Function Reference

processCompletionsAndHandleOverflow() — netty Function Reference

Architecture documentation for the processCompletionsAndHandleOverflow() function in IoUringIoHandler.java from the netty codebase.

Function java Buffer Allocators calls 1 called by 3

Entity Profile

Dependency Diagram

graph TD
  00f4b33f_14c8_6a03_69e4_20eca4fce924["processCompletionsAndHandleOverflow()"]
  54b1e24c_acd2_7686_4313_2695f1b73de1["IoUringIoHandler"]
  00f4b33f_14c8_6a03_69e4_20eca4fce924 -->|defined in| 54b1e24c_acd2_7686_4313_2695f1b73de1
  3febc8f5_f331_c39c_6774_12a24143add8["run()"]
  3febc8f5_f331_c39c_6774_12a24143add8 -->|calls| 00f4b33f_14c8_6a03_69e4_20eca4fce924
  88492ff3_9115_7f63_0291_32ae2900e2a2["prepareToDestroy()"]
  88492ff3_9115_7f63_0291_32ae2900e2a2 -->|calls| 00f4b33f_14c8_6a03_69e4_20eca4fce924
  ba804e78_369a_b616_6db6_06516ef2b298["drainEventFd()"]
  ba804e78_369a_b616_6db6_06516ef2b298 -->|calls| 00f4b33f_14c8_6a03_69e4_20eca4fce924
  b5491639_cc1a_93b0_792f_d7ada8778728["submitAndClearNow()"]
  00f4b33f_14c8_6a03_69e4_20eca4fce924 -->|calls| b5491639_cc1a_93b0_792f_d7ada8778728
  style 00f4b33f_14c8_6a03_69e4_20eca4fce924 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport-classes-io_uring/src/main/java/io/netty/channel/uring/IoUringIoHandler.java lines 191–213

    private int processCompletionsAndHandleOverflow(SubmissionQueue submissionQueue, CompletionQueue completionQueue,
                                         CompletionCallback callback) {
        int processed = 0;
        // Bound the maximum number of times this will loop before we return and so execute some non IO stuff.
        // 128 here is just some sort of bound and another number might be ok as well.
        for (int i = 0; i < 128; i++) {
            int p = completionQueue.process(callback);
            if ((submissionQueue.flags() & Native.IORING_SQ_CQ_OVERFLOW) != 0) {
                logger.warn("CompletionQueue overflow detected, consider increasing size: {} ",
                        completionQueue.ringEntries);
                submitAndClearNow(submissionQueue);
            } else if (p == 0 &&
                    // Check if there are any more submissions pending, if not break the loop.
                    (submissionQueue.count() == 0 ||
                    // Let's try to submit again and check if there are new completions to handle.
                    // Only break the loop if there was nothing submitted and there are no new completions.
                    (submitAndClearNow(submissionQueue) == 0 && !completionQueue.hasCompletions()))) {
                break;
            }
            processed += p;
        }
        return processed;
    }

Domain

Subdomains

Frequently Asked Questions

What does processCompletionsAndHandleOverflow() do?
processCompletionsAndHandleOverflow() is a function in the netty codebase, defined in transport-classes-io_uring/src/main/java/io/netty/channel/uring/IoUringIoHandler.java.
Where is processCompletionsAndHandleOverflow() defined?
processCompletionsAndHandleOverflow() is defined in transport-classes-io_uring/src/main/java/io/netty/channel/uring/IoUringIoHandler.java at line 191.
What does processCompletionsAndHandleOverflow() call?
processCompletionsAndHandleOverflow() calls 1 function(s): submitAndClearNow.
What calls processCompletionsAndHandleOverflow()?
processCompletionsAndHandleOverflow() is called by 3 function(s): drainEventFd, prepareToDestroy, run.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free