You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When at least one mapping is assigned (aka. at least one endpoint needs to be queried) the iot-gateway spins the CPU up to whatever the maximum is. In case of a k8s deployment this means it even runs into CPU throttling.
Connector name (If bug in the some connector):
REQUEST Connector
Versions (please complete the following information):
OS: Docker Image: thingsboard/tb-gateway
Version: 3.6.1
Python version: ?
The text was updated successfully, but these errors were encountered:
I have also taken a cursory look at the code, and the issue seems to be here:
thingsboard_gateway/connectors/request/request_connector.py Line 84 to 95
defrun(self):
whilenotself.__stopped:
ifself.__requests_in_progress: # This seems to be true as soon as one mapping isforrequestinself.__requests_in_progress: # configured, causing the while loop to always run hereiftime() >=request["next_time"]:
thread=Thread(target=self.__send_request, args=(request, self.__convert_queue, self._log),
daemon=True,
name="Request to endpoint \'%s\' Thread"% (request["config"].get("url")))
thread.start()
else: # The above code causes the sleep to never execute so the code will always immediatelysleep(.2) # rerun and never put the thread to sleep
A potential fix could be to simply remove the else before the sleep directive and always allow the thread to sleep for .2s, tho I am not deep enough in the matter to know if this would have other ramifications.
Thank you for your interest in ThingsBoard IoT gateway, participation in project life and your investigation. We have added a fix for this issue, it will be available in next release.
Describe the bug
When at least one mapping is assigned (aka. at least one endpoint needs to be queried) the iot-gateway spins the CPU up to whatever the maximum is. In case of a k8s deployment this means it even runs into CPU throttling.
Connector name (If bug in the some connector):
REQUEST Connector
Versions (please complete the following information):
OS:Docker Image: thingsboard/tb-gatewayThe text was updated successfully, but these errors were encountered: