summaryrefslogtreecommitdiffstats
path: root/aclk
diff options
context:
space:
mode:
authorTimotej S <6674623+underhood@users.noreply.github.com>2022-01-19 20:13:06 +0100
committerGitHub <noreply@github.com>2022-01-19 20:13:06 +0100
commit238a967669288e6d89bc0a2c82bd86520dc99a5c (patch)
tree53eedb05ae2ed29efce61ca556c15bb9baed6e8a /aclk
parent6600f33247368f0b124351abe5e9acf6e49c8cd2 (diff)
Blocking publish and in flight buffer regrowth (#11932)
* implements blocking publish to support huge nodes until new MQTT is ready
Diffstat (limited to 'aclk')
-rw-r--r--aclk/aclk_tx_msgs.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/aclk/aclk_tx_msgs.c b/aclk/aclk_tx_msgs.c
index 0f66ea4ea8..74fc19c728 100644
--- a/aclk/aclk_tx_msgs.c
+++ b/aclk/aclk_tx_msgs.c
@@ -147,7 +147,11 @@ static void aclk_send_message_with_bin_payload(mqtt_wss_client client, json_obje
json_object_to_file_ext(filename, msg, JSON_C_TO_STRING_PRETTY);
#endif */
- mqtt_wss_publish_pid(client, topic, full_msg, len, MQTT_WSS_PUB_QOS1, &packet_id);
+ int rc = mqtt_wss_publish_pid_block(client, topic, full_msg, len, MQTT_WSS_PUB_QOS1, &packet_id, 5000);
+ if (rc == MQTT_WSS_ERR_BLOCK_TIMEOUT)
+ error("Timeout sending binpacked message");
+ if (rc == MQTT_WSS_ERR_TX_BUF_TOO_SMALL)
+ error("Message is bigger than allowed maximum");
#ifdef NETDATA_INTERNAL_CHECKS
aclk_stats_msg_published(packet_id);
#endif