Add check for children connecting to a parent agent with unsupported memory mode (#10787)
Stelios Fragkakis committed
Mar 19, 2021 at 11:04 UTC
59638f03a9a4c0a48591d31f3c0e8985c47a484c
1 file changed
+8
streaming/receiver.c
+8
@@ -261,6 +261,14 @@ static int rrdpush_receive(struct receiver_state *rpt)
261
mode = rrd_memory_mode_id(appconfig_get(&stream_config, rpt->key, "default memory mode", rrd_memory_mode_name(mode)));
262
mode = rrd_memory_mode_id(appconfig_get(&stream_config, rpt->machine_guid, "memory mode", rrd_memory_mode_name(mode)));
263
264
+#ifndef ENABLE_DBENGINE
265
+ if (unlikely(mode == RRD_MEMORY_MODE_DBENGINE)) {
266
+ close(rpt->fd);
267
+ log_stream_connection(rpt->client_ip, rpt->client_port, rpt->key, rpt->machine_guid, rpt->hostname, "REJECTED -- DBENGINE MEMORY MODE NOT SUPPORTED");
268
+ return 1;
269
+ }
270
+#endif
271
+
272
health_enabled = appconfig_get_boolean_ondemand(&stream_config, rpt->key, "health enabled by default", health_enabled);
273
health_enabled = appconfig_get_boolean_ondemand(&stream_config, rpt->machine_guid, "health enabled", health_enabled);
274