increase max response size to 100MiB (#16649)
* increase max response size to 100MiB * do not check the uncompressed message size on aclk
Costa Tsaousis committed
Dec 21, 2023 at 17:21 UTC
8dac5a52bb0e14320fa8fe4a24b9af4fc419fad1
3 files changed
+3
-11
aclk/aclk_query.c
-8
@@ -6,7 +6,6 @@
6
#include "../../web/server/web_client_cache.h"
7
8
#define WEB_HDR_ACCEPT_ENC "Accept-Encoding:"
9
-#define ACLK_MAX_WEB_RESPONSE_SIZE (30 * 1024 * 1024)
9
10
pthread_cond_t query_cond_wait = PTHREAD_COND_INITIALIZER;
11
pthread_mutex_t query_lock_wait = PTHREAD_MUTEX_INITIALIZER;
@@ -137,13 +136,6 @@ static int http_api_v2(struct aclk_query_thread *query_thr, aclk_query_t query)
136
w->response.code = (short)web_client_api_request_with_node_selection(localhost, w, path);
137
web_client_timeout_checkpoint_response_ready(w, &t);
138
140
- if(buffer_strlen(w->response.data) > ACLK_MAX_WEB_RESPONSE_SIZE) {
141
- buffer_flush(w->response.data);
142
- buffer_strcat(w->response.data, "response is too big");
143
- w->response.data->content_type = CT_TEXT_PLAIN;
144
- w->response.code = HTTP_RESP_CONTENT_TOO_LONG;
145
- }
146
-
139
if (aclk_stats_enabled) {
140
ACLK_STATS_LOCK;
141
aclk_metrics_per_sample.cloud_q_process_total += t;
aclk/aclk_tx_msgs.c
+2
-2
@@ -86,7 +86,7 @@ static int aclk_send_message_with_bin_payload(mqtt_wss_client client, json_objec
86
int rc = mqtt_wss_publish5(client, (char*)topic, NULL, full_msg, &freez_aclk_publish5b, full_msg_len, MQTT_WSS_PUB_QOS1, &packet_id);
87
88
if (rc == MQTT_WSS_ERR_TOO_BIG_FOR_SERVER)
89
- return HTTP_RESP_FORBIDDEN;
89
+ return HTTP_RESP_CONTENT_TOO_LONG;
90
91
#ifdef NETDATA_INTERNAL_CHECKS
92
aclk_stats_msg_published(packet_id);
@@ -194,7 +194,7 @@ int aclk_http_msg_v2(mqtt_wss_client client, const char *topic, const char *msg_
194
int rc = aclk_send_message_with_bin_payload(client, msg, topic, payload, payload_len);
195
196
switch (rc) {
197
- case HTTP_RESP_FORBIDDEN:
197
+ case HTTP_RESP_CONTENT_TOO_LONG:
198
aclk_http_msg_v2_err(client, topic, msg_id, rc, CLOUD_EC_REQ_REPLY_TOO_BIG, CLOUD_EMSG_REQ_REPLY_TOO_BIG, NULL, 0);
199
break;
200
case HTTP_RESP_INTERNAL_SERVER_ERROR:
collectors/plugins.d/pluginsd_parser.h
+1
-1
@@ -11,7 +11,7 @@
11
#define WORKER_RECEIVER_JOB_REPLICATION_COMPLETION (WORKER_PARSER_FIRST_JOB - 3)
12
13
// this controls the max response size of a function
14
-#define PLUGINSD_MAX_DEFERRED_SIZE (20 * 1024 * 1024)
14
+#define PLUGINSD_MAX_DEFERRED_SIZE (100 * 1024 * 1024)
15
16
#define PLUGINSD_MIN_RRDSET_POINTERS_CACHE 1024
17