Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor "command timeout" handling #500

Open
mStirner opened this issue Sep 24, 2024 · 1 comment
Open

Refactor "command timeout" handling #500

mStirner opened this issue Sep 24, 2024 · 1 comment

Comments

@mStirner
Copy link
Member

The timeout should apply to the time between when the data was sendet and the answer from the device.
When no connector is available, the connection timeout should apply, but instead the "command timeout" fires before the end of the "connection timeout" (default 30s) was reached.

When the connection timeout > command timeout (which is the case) then the command timeout fires every time before the connection timeout.

Correct flow would be:
on success

  • trigger command
  • opens connection
  • send command payload
  • waits for response
  • timeout or receive response

on failure

  • trigger command
  • opens connection
  • connections request timesout
  • no "command timeout" is fired

NOTE: Keep in mind that changing this also affect the "Presets" handling in endpoints (#439)

@mStirner
Copy link
Member Author

There are/should be 3 timeouts:

  • connection timeout (bridge/connector)
  • command timeout (general, command not send/no response)
  • command response timeout (response from device)

"Connection timeout" should be relative high e.g. 30s.
"Command timeout" should be higher than response timeout, e.g. 5s.
"Command response timeout" should be lower than "command timeout", e.g. 2s

3s between sending the command, and receiving a response from a API/device should be more than enough for the most scenarios.

The 5s "command timeout" is there to log that the command request/payload was not even written to the device/API. (is this even needed?, when "connect timeout" exists.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant