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

Enable application/protocol to set response timeout in CommandSender #7489

Closed
pan-apple opened this issue Jun 9, 2021 · 1 comment
Closed
Assignees
Labels

Comments

@pan-apple
Copy link
Contributor

Problem

The current CommandSender code uses a fixed timeout value for all commands.

In

CHIP_ERROR CommandSender::SendCommandRequest(NodeId aNodeId, Transport::AdminId aAdminId, SecureSessionHandle * secureSession)
    mpExchangeCtx->SetResponseTimeout(kImMessageTimeoutMsec);

kImMessageTimeoutMsec is currently 6 seconds.

Individual protocols could have different timeout requirements based on how long the peer takes to process the command, and what transport is being used for the message transmission.

For example, commands that require peer to use crypto operations (such as generate CSR) might take longer than command to toggle a light bulb.

And, commands going over CRMP vs BLE may have different timeout requirements to account for the message retries and retry timeouts.

Instead of having a fixed timeout for all applications/protocols, we should provide an API to the application/protocol to set the timeout value.

Proposed Solution

Add an API to CommandSender to set the command timeout value. The CommandSender can use the current value (kImMessageTimeoutMsec) as the default timeout, in case the application doesn't override it.

Add unit tests.

Integrate the API to individual protocols that have non-default timeout requirements.

doru91 added a commit to doru91/connectedhomeip that referenced this issue Jun 9, 2021
On K32W, chip-device-ctrl times out while waiting for the OpCSR.
Double the IM timeout for the moment.

See also:
- project-chip#7489

Signed-off-by: Doru Gucea <[email protected]>
andy31415 pushed a commit that referenced this issue Jun 9, 2021
* [K32W] Increase IM timeout

On K32W, chip-device-ctrl times out while waiting for the OpCSR.
Double the IM timeout for the moment.

See also:
- #7489

Signed-off-by: Doru Gucea <[email protected]>

* Restyled by clang-format

Co-authored-by: Restyled.io <[email protected]>
andy31415 pushed a commit that referenced this issue Jun 9, 2021
* [K32W] Increase IM timeout

On K32W, chip-device-ctrl times out while waiting for the OpCSR.
Double the IM timeout for the moment.

See also:
- #7489

Signed-off-by: Doru Gucea <[email protected]>

* Restyled by clang-format

Co-authored-by: Restyled.io <[email protected]>
doublemis1 pushed a commit to doublemis1/connectedhomeip that referenced this issue Jul 7, 2021
* [K32W] Increase IM timeout

On K32W, chip-device-ctrl times out while waiting for the OpCSR.
Double the IM timeout for the moment.

See also:
- project-chip#7489

Signed-off-by: Doru Gucea <[email protected]>

* Restyled by clang-format

Co-authored-by: Restyled.io <[email protected]>
@yufengwangca yufengwangca self-assigned this Aug 19, 2021
nikita-s-wrk pushed a commit to nikita-s-wrk/connectedhomeip that referenced this issue Sep 23, 2021
* [K32W] Increase IM timeout

On K32W, chip-device-ctrl times out while waiting for the OpCSR.
Double the IM timeout for the moment.

See also:
- project-chip#7489

Signed-off-by: Doru Gucea <[email protected]>

* Restyled by clang-format

Co-authored-by: Restyled.io <[email protected]>
@woody-apple
Copy link
Contributor

What is required here @pan-apple ?

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

No branches or pull requests

4 participants