Ticket #359 (new defect)

Opened 5 years ago

Client/telldusd goes into loop sending repeated commands in specific scenario

Reported by: johan ström <johan@…> Owned by:
Priority: major Milestone:
Component: telldus-core Version:
Keywords: Cc:
Blocked By: Blocking:
Platform: Linux Sensitive: no
Verified by Telldus: no

Description

(Short recap in english from  http://www.telldus.com/forum/viewtopic.php?f=8&p=25499#p25499])

Running master (77c93d1c7c2cb0e7528faae3bf347f074b126989), and having a slow archtech selflearning dimmer (3.2s execution time for tdDim). Platform is really FreeBSD, not Linux but should not make any difference.

Sending two tdDim in short succession will get the second sender's sendToService method into a loop, sending the tdDim command up to 20 times, effectively blocking telldusd from handling any other requests.

Source of problem:
1s timeout in sendToService, in combination with telldusd only handling commands via the mainloop, which is blocked by the long-running tdDim. sendToService timesout and re-sends, but telldusd still picks up the msg and executes it.. And so it goes on.

Two solutions:

  • Increase read timeout (not a real solution)
  • Allow telldusd to execute the actions in a standalone thread, not blocking the main thread.
Note: See TracTickets for help on using tickets.