fix redis get key command block

(cherry picked from commit c72f83d20167ea044e96838f3a2d064e3bfcf5cc)
This commit is contained in:
jiangheng 2022-03-18 15:18:23 +08:00 committed by openeuler-sync-bot
parent dd27a20773
commit af001f2ca7
2 changed files with 56 additions and 1 deletions

View File

@ -0,0 +1,50 @@
From 6b05f21de47d2e3a49e6d99ee8a6af773266f117 Mon Sep 17 00:00:00 2001
From: jiangheng <jiangheng12@huawei.com>
Date: Fri, 18 Mar 2022 14:54:37 +0800
Subject: [PATCH] the sending of sock last data is triggered by lstack
---
src/lstack/core/lstack_lwip.c | 5 +++--
src/lstack/core/lstack_protocol_stack.c | 3 ++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/lstack/core/lstack_lwip.c b/src/lstack/core/lstack_lwip.c
index 7bab92f..b4d75d2 100644
--- a/src/lstack/core/lstack_lwip.c
+++ b/src/lstack/core/lstack_lwip.c
@@ -214,7 +214,7 @@ void stack_replenish_send_idlembuf(struct protocol_stack *stack)
uint32_t replenish_cnt = rte_ring_free_count(stack->send_idle_ring);
for (uint32_t i = 0; i < replenish_cnt; i++) {
- struct pbuf *pbuf = lwip_alloc_pbuf(PBUF_TRANSPORT, MAX_PACKET_SZ - PBUF_TRANSPORT, PBUF_RAM);
+ struct pbuf *pbuf = lwip_alloc_pbuf(PBUF_TRANSPORT, TCP_MSS, PBUF_RAM);
if (pbuf == NULL) {
break;
}
@@ -361,7 +361,8 @@ void stack_send(struct rpc_msg *msg)
msg->result = write_lwip_data(sock, fd, flags);
__atomic_store_n(&sock->have_rpc_send, false, __ATOMIC_RELEASE);
- if (msg->result >= 0 && rte_ring_count(sock->send_ring)) {
+ if (msg->result >= 0 &&
+ (rte_ring_count(sock->send_ring) || sock->send_lastdata)) {
if (list_is_empty(&sock->send_list)) {
__atomic_store_n(&sock->have_rpc_send, true, __ATOMIC_RELEASE);
list_add_node(&stack->send_list, &sock->send_list);
diff --git a/src/lstack/core/lstack_protocol_stack.c b/src/lstack/core/lstack_protocol_stack.c
index 1de546d..e5761a4 100644
--- a/src/lstack/core/lstack_protocol_stack.c
+++ b/src/lstack/core/lstack_protocol_stack.c
@@ -350,7 +350,8 @@ static void send_stack_list(struct protocol_stack *stack)
ssize_t ret = write_lwip_data(sock, sock->conn->socket, sock->send_flags);
__atomic_store_n(&sock->have_rpc_send, false, __ATOMIC_RELEASE);
- if (ret >= 0 && rte_ring_count(sock->send_ring)) {
+ if (ret >= 0 &&
+ (rte_ring_count(sock->send_ring) || sock->send_lastdata)) {
__atomic_store_n(&sock->have_rpc_send, true, __ATOMIC_RELEASE);
} else {
list_del_node_init(&sock->send_list);
--
1.8.3.1

View File

@ -2,7 +2,7 @@
Name: gazelle
Version: 1.0.1
Release: 4
Release: 5
Summary: gazelle is a high performance user-mode stack
License: Mulan PSL v2
URL: https://gitee.com/openeuler/gazelle
@ -50,6 +50,7 @@ Patch9032: 0032-modify-readme-to-add-constraint.patch
Patch9033: 0033-fix-accept-check-remain-conn.patch
Patch9034: 0034-fix-wakeup-list-dead-loop.patch
Patch9035: 0035-add-check-for-stack-params.patch
Patch9036: 0036-the-sending-of-sock-last-data-is-triggered-by-lstack.patch
%description
%{name} is a high performance user-mode stack.
@ -90,6 +91,10 @@ install -Dpm 0640 %{_builddir}/%{name}-%{version}/src/ltran/ltran.conf %{b
%config(noreplace) %{conf_path}/ltran.conf
%changelog
* Fri Mar 18 2022 jiangheng <jiangheng12@huawei.com> - 1.0.1-5
- limit lwip_alloc_pbuf size to TCP_MSS
- sending of sock last data is triggered by lstack iteself
* Thu Mar 17 2022 jiangheng <jiangheng12@huawei.com> - 1.0.1-4
- fix repeatede stack restart coredump