When developing plugin, I set a timer to send Ajax request from vClient to vCenter Server.
Sometimes the Ajax request will get no response. I believe it is not the problem about cache, because I have add time stamp at the end of the URL.
I have tried using different Ajax lib to send request, it performed no difference.
All the code is simple and pure, just for test.
The following is my test results.
Timer | Synchronous/Asynchronous | Timer interval | Process time on server | Platform | Description |
---|---|---|---|---|---|
setInterval | synchronous | 20s | <1s | vClient and Vcenter Server | It is easy to cause vClient no response. |
setInterval | asynchronous | 20s | <1s | vClient and Vcenter Server | It's not stable. Sometimes it works well. Sometimes the back-end will miss some requests. I have capture the package and found that package has been sent from vClient. But the ack response from vCenter Server seems strange sometimes. |
setTimeout | asynchronous | 20s | <1s | vClient and Vcenter Server | It's not stable. Usually, the first request is ok, the second will fail, the third is ok, the fourth will fail. Also, the package has been sent from vClient. |
setInterval | asynchronous | 20s | <1s | FireFox, tomcat | Everything is normal. |
setInterval | asynchronous | 20s | <1s | IE, tomcat | Everything is normal. |
setInterval | asynchronous | 20s | <1s | FireFox/IE, vCente Server | Everything is normal. |
setInterval | asynchronous | 20s | <1s | vClient, tomcat | Everything is normal. |
What is the problem?