-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Slow Response/Socket Timeout Exceptions while scanning for VMs #2033
Comments
@anuchandy @anudeepsharma Let me know if you have any suggestions? Thanks! |
When you initialize an Azure instance, you can configure the connection timeout: Azure azure = Azure.configure()
.withConnectionTimeout(5, TimeUnit.MINUTES)
.authenticate(credFile)
.withDefaultSubscription(); |
To list VMs, there are 2 methods that does automatic paging: azure.virtualMachines().listAsync()
.doOnNext(new Action1<VirtualMachine>() {
@Override
public void call(VirtualMachine virtualMachine) {
}
}); This will also automatically page through all the VMs and should only cache a page of VMs in the memory at a time. |
Thanks @jianghaolu |
.withConnectionTimeout(5, TimeUnit.MINUTES) |
We have the same issue. Increasing the timeout does not work. There is something fundamental changed recently that we started seeing it. It may go away for a bit and then it comes back. |
There are 3 timeouts associated with the client, connection timeout, read timeout, and write timeout. Currently we only expose configurations on connection timeout and read timeout and their default values are 10 seconds and 60 seconds respectively. This will give you a bit of a guess which one is timing out when you don't have a lot of other info. You can configure them both on |
Closing the issue, @puneet101 @menih kindly re-open the issue if you are still running into the tmeouts. |
We look at all the VMs on Azure using listByResourceGroup() and it's timing out with only ~80 VMs in the tenant:
PagedList vms = azureInstance.virtualMachines().listByResourceGroup(rg);
Questions:
#1
Is there a configurable timeout?
#2
What's the recommended approach to traverse through VMs when the tenant has 100's or 1000's of VMs.
We see this in our error logs:
Caused by: java.lang.RuntimeException: java.net.SocketTimeoutException: timeout
Mar 23 03:13:44 workspot-o1works1 app/worker.1: at rx.exceptions.Exceptions.propagate(Exceptions.java:58)
Mar 23 03:13:44 workspot-o1works1 app/worker.1: at rx.observables.BlockingObservable.blockForSingle(BlockingObservable.java:464)
Mar 23 03:13:44 workspot-o1works1 app/worker.1: at rx.observables.BlockingObservable.single(BlockingObservable.java:341)
Mar 23 03:13:44 workspot-o1works1 app/worker.1: at com.microsoft.azure.management.compute.implementation.VirtualMachinesInner.list(VirtualMachinesInner.java:1441)
The text was updated successfully, but these errors were encountered: