Ignore:
Timestamp:
2018-09-22T00:00:37+02:00 (6 years ago)
Author:
wiktorn
Message:

Retry tile download on transient errors.

Till now there was no strategy to retry tile download. Tiles for which download
finished with error where by design not downloaded again. Because we were
issuing surplus download requests it was not easy to notice, that some tiles
where downloaded at different zoom level. When surplus downloads where removed -
problem became aparent.

Redefine semantics in AbstractTileSourceLayer, that all Tiles that are not
loaded are tried again. Move all logic deciding whether tile has loaded or not
to TMSCachedTileLoaderJob.

Implment in TMSCachedTileLoaderJob following rules:

  • when HTTP status code is between 400 and 500 - treat errors as permament
  • when HTTP status code equals or is greater than 500 - then treat error as

temporary

  • when there was exception in JCSCachedTileLoaderJob, then HTTP status code is

set to 599. Treat this as permament error. This is suboptimal, as we could treat
Socket read timeout and similar as temporary, and UnkownHostException as
permament

The other aproach is to implement retry count in Tile and retry for finite
number of times, preferably with some delay between tries.

Closes: #16747
See: #16743

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java

    r14260 r14268  
    303303            tile.setImage(null);
    304304        }
    305         tile.setLoaded(success);
    306305        invalidateLater();
    307306        Logging.debug("tileLoadingFinished() tile: {0} success: {1}", tile, success);
     
    461460                    }
    462461                }
     462                content.add(Arrays.asList(tr("Status:"), tr(tile.getStatus())));
     463                content.add(Arrays.asList(tr("Loaded:"), tr(Boolean.toString(tile.isLoaded()))));
     464                content.add(Arrays.asList(tr("Loading:"), tr(Boolean.toString(tile.isLoading()))));
     465                content.add(Arrays.asList(tr("Error:"), tr(Boolean.toString(tile.hasError()))));
    463466                for (List<String> entry: content) {
    464467                    panel.add(new JLabel(entry.get(0) + ':'), GBC.std());
     
    889892        if (tile == null)
    890893            return false;
    891         if (!force && (tile.isLoaded() || tile.hasError()))
     894        if (!force && tile.isLoaded())
    892895            return false;
    893896        if (tile.isLoading())
Note: See TracChangeset for help on using the changeset viewer.