diff options
author | Costa Tsaousis <costa@netdata.cloud> | 2023-12-21 17:21:56 +0200 |
---|---|---|
committer | Tasos Katsoulas <12612986+tkatsoulas@users.noreply.github.com> | 2024-02-06 16:33:22 +0200 |
commit | 58f0d6aeec4389b71a83a8ee758ff4a756013f0e (patch) | |
tree | 1b8e4006ed20c2b606b517972455552aa36e5a9f | |
parent | f740c764861f5ebc8992d6662f04aa5932ad3975 (diff) |
increase max response size to 100MiB (#16649)
* increase max response size to 100MiB
* do not check the uncompressed message size on aclk
(cherry picked from commit 8dac5a52bb0e14320fa8fe4a24b9af4fc419fad1)
-rw-r--r-- | aclk/aclk_query.c | 8 | ||||
-rw-r--r-- | aclk/aclk_tx_msgs.c | 4 | ||||
-rw-r--r-- | collectors/plugins.d/pluginsd_parser.h | 2 |
3 files changed, 3 insertions, 11 deletions
diff --git a/aclk/aclk_query.c b/aclk/aclk_query.c index da5385fdb8..5e3574b978 100644 --- a/aclk/aclk_query.c +++ b/aclk/aclk_query.c @@ -6,7 +6,6 @@ #include "../../web/server/web_client_cache.h" #define WEB_HDR_ACCEPT_ENC "Accept-Encoding:" -#define ACLK_MAX_WEB_RESPONSE_SIZE (30 * 1024 * 1024) pthread_cond_t query_cond_wait = PTHREAD_COND_INITIALIZER; 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) w->response.code = (short)web_client_api_request_with_node_selection(localhost, w, path); web_client_timeout_checkpoint_response_ready(w, &t); - if(buffer_strlen(w->response.data) > ACLK_MAX_WEB_RESPONSE_SIZE) { - buffer_flush(w->response.data); - buffer_strcat(w->response.data, "response is too big"); - w->response.data->content_type = CT_TEXT_PLAIN; - w->response.code = HTTP_RESP_CONTENT_TOO_LONG; - } - if (aclk_stats_enabled) { ACLK_STATS_LOCK; aclk_metrics_per_sample.cloud_q_process_total += t; diff --git a/aclk/aclk_tx_msgs.c b/aclk/aclk_tx_msgs.c index 4102c818d3..0e4182a729 100644 --- a/aclk/aclk_tx_msgs.c +++ b/aclk/aclk_tx_msgs.c @@ -86,7 +86,7 @@ static int aclk_send_message_with_bin_payload(mqtt_wss_client client, json_objec int rc = mqtt_wss_publish5(client, (char*)topic, NULL, full_msg, &freez_aclk_publish5b, full_msg_len, MQTT_WSS_PUB_QOS1, &packet_id); if (rc == MQTT_WSS_ERR_TOO_BIG_FOR_SERVER) - return HTTP_RESP_FORBIDDEN; + return HTTP_RESP_CONTENT_TOO_LONG; #ifdef NETDATA_INTERNAL_CHECKS 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_ int rc = aclk_send_message_with_bin_payload(client, msg, topic, payload, payload_len); switch (rc) { - case HTTP_RESP_FORBIDDEN: + case HTTP_RESP_CONTENT_TOO_LONG: aclk_http_msg_v2_err(client, topic, msg_id, rc, CLOUD_EC_REQ_REPLY_TOO_BIG, CLOUD_EMSG_REQ_REPLY_TOO_BIG, NULL, 0); break; case HTTP_RESP_INTERNAL_SERVER_ERROR: diff --git a/collectors/plugins.d/pluginsd_parser.h b/collectors/plugins.d/pluginsd_parser.h index 3547464293..1fce9a89ab 100644 --- a/collectors/plugins.d/pluginsd_parser.h +++ b/collectors/plugins.d/pluginsd_parser.h @@ -11,7 +11,7 @@ #define WORKER_RECEIVER_JOB_REPLICATION_COMPLETION (WORKER_PARSER_FIRST_JOB - 3) // this controls the max response size of a function -#define PLUGINSD_MAX_DEFERRED_SIZE (20 * 1024 * 1024) +#define PLUGINSD_MAX_DEFERRED_SIZE (100 * 1024 * 1024) #define PLUGINSD_MIN_RRDSET_POINTERS_CACHE 1024 |