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

Long imagery timeout starves other imagery layers #7974

Closed
OmarShehata opened this issue Jun 30, 2019 · 2 comments · Fixed by #8028
Closed

Long imagery timeout starves other imagery layers #7974

OmarShehata opened this issue Jun 30, 2019 · 2 comments · Fixed by #8028

Comments

@OmarShehata
Copy link
Contributor

This was reported on the forum. I initially thought it was the same imagery request issue I fixed here #7914, but this is different.

If you open this Sandcastle example, you'll see no imagery loading for a good 20-30 seconds. Even after it loads, any new imagery requests are similarly delayed. This very long delay goes away if you uncheck the "Broken Layer".

The "broken layer" is a URL (https://demo.boundlessgeo.com/geoserver/wms) which takes 20-30 seconds to time out with the error Chrome error:

Failed to load resource: net::ERR_CONNECTION_TIMED_OUT

CesiumJS catches this fine and returns An error occurred in "WebMapServiceImageryProvider": Failed to obtain image tile X: 1 Y: 0 Level: 0. I think this is a bug because:

What I expect to happen

  1. Requests for Bing imagery go out
  2. Requests for broken layer go out
  3. Bing imagery requests succeed, more Bing requests go out

So overall the scene continues to load even though one imagery layer takes forever to respond.

Instead what happens

  1. Requests for Bing imagery go out
  2. Requests for broken layer go out
  3. Bing imagery requests succeed, but no more Bing requests go out until the broken layer's requests respond.

So the scene is frozen and the working imagery layer(s) do not load.

For whoever is looking into this, some helpful places to start:

  • ImageryLayer.js#L790 is where the requests go out. Notice it's throttled by server, but not throttled generally. I believe this means CesiumJS keeps track of how many requests are waiting on each server, so it should be able to handle this case where one slow server doesn't starve everything else.
  • RequestScheduler.js#L64-L78 has the default number of maximum requests in general, and per server.
  • ImageryProvider.js#L355 this is where the actual image is fetched, and the promise is created (this is the promise returneed to ImageryLayer.js above). Beyond that, you can go into Resource.js to see what happens when you fetch an image.
@sfariaNG
Copy link
Contributor

sfariaNG commented Jul 29, 2019

I created a today PR that should address the underlying issue behind this. It works on our side, but let me know if you see any issues with it.

@cesium-concierge
Copy link

Congratulations on closing the issue! I found these Cesium forum links in the comments above:

https://groups.google.com/d/msg/cesium-dev/USnvihDHUic/LWJ1eQqrBAAJ

If this issue affects any of these threads, please post a comment like the following:

The issue at #7974 has just been closed and may resolve your issue. Look for the change in the next stable release of Cesium or get it now in the master branch on GitHub https://github.com/AnalyticalGraphicsInc/cesium.

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

Successfully merging a pull request may close this issue.

3 participants