Skip to content

Commit

Permalink
lib/jsonrpc: Return busy poller state if there are oustanding requests
Browse files Browse the repository at this point in the history
RPC poller switches to active polling mode when something is received
or sent on RPC socket. Active polling dureation is 4ms. After that RPC
poller switches back to timed ppoller mode with 4ms interval. If RPC
is asynchronous and its execution time is longer than 4ms, the
response will be delayed because it will be sent out only on the next
RPC poller cycle.

When we have outstanding requests we expect to have response
soon. Reporting busy from jsonrpc server in this case helps to keep
RPC poller in active polling mode and avoid response delay.

Signed-off-by: Evgeniy Kochetov <evgeniik@nvidia.com>
  • Loading branch information
EugeneKochetov committed Jul 8, 2024
1 parent 2025756 commit 6f9f4d3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/jsonrpc/jsonrpc_server_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,10 @@ spdk_jsonrpc_server_poll(struct spdk_jsonrpc_server *server)
} else if (rc > 0) {
busy = 1;
}

if (!STAILQ_EMPTY(&conn->outstanding_queue)) {
busy = 1;
}
}
}

Expand Down

0 comments on commit 6f9f4d3

Please sign in to comment.