Comments (5)
Pushed ! It should be fixed now. Thanks !
from haproxy.
To make things easy to reproduce, we can load the map referencing the config-file, reload haproxy and try and clear the map right after a usual reload.
No need to use add map
to reproduce the issue
from haproxy.
Thanks for the report @felipewd!
static int cli_io_handler_clear_map(struct appctx *appctx)
{
struct show_map_ctx *ctx = appctx->svcctx;
int finished;
HA_RWLOCK_WRLOCK(PATREF_LOCK, &ctx->ref->lock);
finished = pat_ref_purge_range(ctx->ref, ctx->curr_gen, ctx->prev_gen, 100);
HA_RWLOCK_WRUNLOCK(PATREF_LOCK, &ctx->ref->lock);
if (!finished) {
/* let's come back later */
applet_have_more_data(appctx);
map pruning is segmented through batches of 100 entries each to prevent the process from monopolizing a CPU core which would cause contention otherwise. If entries still remain after a pruning batch, the applet is re-scheduled to continue where it left off.
As you pointed out this used to work properly in the past, but since f37ddbe ("MAJOR: cli: Update the CLI applet to handle its own buffers") it looks like the applet is not woken back properly and because of that it doesn't get the chance to finish the pruning process, and only a few hundreds items maximum are removed. When this happens, we can also notice that the cli command hangs instead of returning promptly.
from haproxy.
Indeed. Thanks @Darlelet ! The issue is in sc_applet_recv()
. SE_FL_HAVE_NO_DATA
flag is updated in the same way than for muxes while it is in fact the applet responsibility to do so. I will push a commit soon. But in the mean time the following should fix the issue:
diff --git a/src/stconn.c b/src/stconn.c
index 930b92b1bd..621d51e429 100644
--- a/src/stconn.c
+++ b/src/stconn.c
@@ -2094,9 +2094,7 @@ int sc_applet_recv(struct stconn *sc)
}
done_recv:
- if (!cur_read)
- se_have_no_more_data(sc->sedesc);
- else {
+ if (cur_read) {
channel_check_xfer(ic, cur_read);
sc_ep_report_read_activity(sc);
}
@@ -2125,12 +2123,7 @@ int sc_applet_recv(struct stconn *sc)
sc->flags |= SC_FL_ERROR;
ret = 1;
}
- else if (!cur_read &&
- !(sc->flags & (SC_FL_WONT_READ|SC_FL_NEED_BUFF|SC_FL_NEED_ROOM)) &&
- !(sc->flags & (SC_FL_EOS|SC_FL_ABRT_DONE))) {
- se_have_no_more_data(sc->sedesc);
- }
- else {
+ else if (cur_read || (sc->flags & (SC_FL_WONT_READ|SC_FL_NEED_BUFF|SC_FL_NEED_ROOM))) {
se_have_more_data(sc->sedesc);
ret = 1;
}
from haproxy.
hey @capflam I can confirm this patches fixes the issue, thanks!
from haproxy.
Related Issues (20)
- add `cap_sys_admin` to setcap supported caps HOT 7
- couple of Y2K38_SAFETY issues suspected by coverity HOT 1
- Stream state processing errors caused by special characters HOT 3
- QUIC: stalled connection rejection causing stalled connection reopening HOT 3
- 3 null pointer suspects from coverity HOT 3
- netbsd compile warnings: "warning: array subscript has type βcharβ"
- At least since 3.0-dev7 peers/stick table related crashes HOT 17
- I am using haproxy service port 3108. How should I use it to send to a different IP band? HOT 2
- src/log.c: null pointer dereference suspected by coverity HOT 2
- Allow to rewrite http-request value after server selection HOT 7
- 3.0-dev* sometimes logs two spaces between captures and http_request HOT 9
- src/clock.c: build failed on solaris HOT 5
- Haproxy crashing on OpenBSD HOT 18
- `allow-dup-ip` is ignored if server has `resolvers` and backend has `default-server` HOT 2
- Log-forwarding via syslog ring does not work anymore HOT 19
- Reg-tests timeouts HOT 3
- QUIC: segfault in qcc_recv_stop_sending HOT 6
- Modify Request Body / Response Body Before Sending To Server Or Client HOT 3
- HAProxy forwards authority format URI with differences HTTP Method, in violation of RFC 9110 HOT 6
- Hello, I am experiencing a sudden termination here that causes the service to go down haproxy: Thread 14 is about to kill the process. HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from haproxy.