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

Update javadoc to reflect recent LinkageCache changes #947

Merged
merged 3 commits into from
Nov 1, 2024

Conversation

abyrd
Copy link
Member

@abyrd abyrd commented Oct 25, 2024

This is a pure documentation change, fixing some obsolete information I noticed during a recent call.

The final block of documentation in the changeset was changed only for consistency with surrounding comments. It will take longer to work through the open questions in that block and verify current behavior. That would be useful, but I don't think I will reach reliable conclusions on that part by the time we do the release.

Copy link
Member

@ansoncfit ansoncfit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made one small suggestion for clarity.

In our recent discussion, I mentioned a vague memory of another comment that might need to be updated. Is the description here still correct?

// Pull all necessary inputs into cache in a blocking fashion, unlike single-point tasks where prep is async.
// Avoids auto-shutdown while preloading. Must be done after loading destination pointsets to establish extents.
// Note we're completely bypassing the async loader here and relying on the older nested LoadingCaches.
// If those are ever removed, the async loader will need a synchronous mode with per-path blocking (kind of
// reinventing the wheel of LoadingCache) or we'll need to make preparation for regional tasks async.
TransportNetwork transportNetwork = networkPreloader.synchronousPreload(task);

src/main/java/com/conveyal/r5/analyst/LinkageCache.java Outdated Show resolved Hide resolved
@abyrd
Copy link
Member Author

abyrd commented Nov 1, 2024

Is the description here still correct?

I think it is still correct, though the way it's phrased might be confusing. When it says "completely bypassing the async loader" it means that while we're still using the async loader class, we're using a method on that class that intentionally skips all the async or background proccessing machinery.

When a regional analysis starts up, we have N tasks all trying to preload at once, and they all block on this method. We don't want N threads performing the slow or heavy calculation steps of preloading redundantly. Nothing in the async loader class itself is causing them to take turns or wait for one preload to finish and share with the other threads. But behind the preloader class there are other caches that do enforce turn-taking and prevent redundant work.

Copy link
Member

@ansoncfit ansoncfit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@abyrd abyrd merged commit 9ba72c3 into dev Nov 1, 2024
3 checks passed
@abyrd abyrd deleted the LinkageCache-javadoc branch November 1, 2024 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants