Skip to content

Commit

Permalink
add comments explaining current exception behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
abyrd committed Oct 31, 2024
1 parent f26f116 commit 2c1bc95
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/main/java/com/conveyal/r5/analyst/NetworkPreloader.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ public LoaderState<TransportNetwork> preload (AnalysisWorkerTask task) {
* similar tasks will make interleaved calls to setProgress (with superficial map synchronization). Other than
* causing a value to briefly revert from PRESENT to BUILDING this doesn't seem deeply problematic.
* This is provided specifically for regional tasks, to ensure that they remain in preloading mode while all this
* data is prepared.
* data is prepared.
* Any exceptions that occur while building the network will escape this method, leaving the status as BUILDING.
*/
public TransportNetwork preloadBlocking (AnalysisWorkerTask task) {
return getBlocking(Key.forTask(task));
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/com/conveyal/r5/util/AsyncLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ public String toString() {
}
}

/** This has been factored out of the executor runnables so subclasses can force a blocking (non-async) load. */
/**
* This has been factored out of the executor runnables so subclasses can force a blocking (non-async) load.
* Any exceptions that occur while building the value will escape this method, leaving the status as BUILDING.
*/
protected V getBlocking (K key) {
setProgress(key, 0, "Starting...");
V value = buildValue(key);
Expand All @@ -111,6 +114,7 @@ protected V getBlocking (K key) {
* Attempt to fetch the value for the supplied key.
* If the value is not yet present, and not yet being computed / fetched, enqueue a task to do so.
* Return a response that reports status, and may or may not contain the value.
* Any exception that occurs while building the value is caught and associated with the key with a status of ERROR.
*/
public LoaderState<V> get (K key) {
LoaderState<V> state = null;
Expand Down

0 comments on commit 2c1bc95

Please sign in to comment.