geosolutions-it/geowebcache

[General] Improve Round Robin Computation for WMS Layers

Opened this issue · 2 comments

[General] Improve Round Robin Computation for WMS Layers

It is currently NOT threasafe at all!

The current code from WMSLayer is shared from different concurrent callers:

/**
 * Get the WMS backend URL that should be used next according to the round robin.
 * 
 * @return the next URL
 */
protected String nextWmsURL() {
    curWmsURL = (curWmsURL + 1) % wmsUrl.length;
    return wmsUrl[curWmsURL];
}

I guess we can do something better. I would for an instance randomize the number or make it thread safe if possible without touchin scalability.

Il giorno 06/giu/2013 17:18, "Simone Giannecchini" notifications@github.com
ha scritto:

It is currently NOT threasafe at all!


Reply to this email directly or view it on GitHub.