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

[Bug Report] The Direct method on a Azure IoT device timeouts after 24 seconds even after passing higher responseTimeoutInSeconds and connectTimeoutInSeconds to invoke method from DeviceMethod class #1791

Closed
dudheprajwal opened this issue Jul 9, 2024 · 1 comment
Labels

Comments

@dudheprajwal
Copy link

dudheprajwal commented Jul 9, 2024

Context

  • OS and version used: Windows 11
  • Java runtime used: JDK 11
  • SDK version used: IoT service client 1.34.2

Description of the issue

The Direct method on a Azure IoT device timeouts after 24 seconds with passing higher responseTimeoutInSeconds and connectTimeoutInSeconds to invoke method from DeviceMethod class. The reason for the issue is the below code:

`DeviceOperations.request(var10000, url, var10002, var10003, String.valueOf(var11), this.options.getHttpConnectTimeout(), this.options.getHttpReadTimeout(), proxy);

The above part of code is executed from invokeMethod method from DeviceMethod class. This method is called in the hierarchy of invoke method from DeviceMethod class. The invoke method accepts the responseTimeoutInSeconds and connectTimeoutInSeconds bit, they are of no significance because of getHttpConnectTimeout() and getHttpReadTimeout() used with the DeviceOperations.request method. The default values for this parameters is 24 seconds. Hence, even if we pass 30 sec as responseTimeoutInSeconds and connectTimeoutInSeconds for invoke method, the Direct method gets timed out after 24 seconds. So, there is no meaning to provide responseTimeoutInSeconds and connectTimeoutInSeconds.

Console log of the issue

Read timed out

@timtay-microsoft
Copy link
Member

I believe versions 2.x.x got rid of this odd 24 second timeout, so I'd recommend upgrading to that version. As it stands, we don't plan on making any changes to the 1.X.X SDK versions.

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

2 participants