VMware {code} Community
manfred9999
Contributor
Contributor

WaitForUpdates Hangs

Hello

I use WaitForUpdates to receive new events. Somtimes my application hangs on the line of code where the WaitForUpdates is called.

I don't see a solutin to avoid this problem. Does anyone have any simular expierience?

Regards

Manfred

0 Kudos
4 Replies
admin
Immortal
Immortal

Hi,

Is there any particular event on which the wiatforupadtes hangs when you are trying to retrieve the updates? You can also cross check if you are facing similar problem if you connect to vCenter or an ESX host directly.

0 Kudos
manfred9999
Contributor
Contributor

Hello Angela

Thank you for the reply. I could not find any particular event connected with this problem. My application just stops responding and stops on the methode waitforupdates.

I suspect it is some invalid function in my code causing the problem. It is very difficult to track, because it occures randomly somtimes often and like right now I wait already for a couple of days but it never occured.

Regards

Manfred

0 Kudos
jasper9890
Enthusiast
Enthusiast

I know this is a 3 year old thread and all but thought I would pass on some info in case anyone comes across it.

That call is depricated in 4.1.  It could cause sockets to be left open on the hosts.  It's suggested to use WaitForUpdatesEx instead.

https://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/vmodl.query.PropertyCollect...

0 Kudos
Steve_Jin
Expert
Expert

The WaitForUpdate() and the newer  WaitForUpdateEx() is designed to be "hanging." You have two choices:

1. Use the RetrieveProperties, or RetrievePropertiesEx()

2. Use a different thread to call the WaitForUpdate() and the newer WaitForUpdateEx()

Hope it helps!

Steve Jin, Author of VMware VI and vSphere SDK, Creator of open source VI Java API managing vSphere, http://www.doublecloud.org

Steve JIN Author of VMware VI and vSphere SDK; Creator of open source VI Java API (http://vijava.sf.net); Blogger at http://www.doublecloud.org
0 Kudos