Skip to content

fix: Added a shared in-progress VersionInfo returned to concurrent callers#2086

Open
qcdyx wants to merge 3 commits intomasterfrom
2021-missing-validatorversion-value-from-gtfs-validation-report
Open

fix: Added a shared in-progress VersionInfo returned to concurrent callers#2086
qcdyx wants to merge 3 commits intomasterfrom
2021-missing-validatorversion-value-from-gtfs-validation-report

Conversation

@qcdyx
Copy link
Contributor

@qcdyx qcdyx commented Jan 29, 2026

Summary:

Closes #2021

Expected behavior:
Keep and return a single shared “in‑progress” VersionInfo once resolution starts. Set the current version synchronously before kicking off the background fetch of the latest release. If another request arrives during resolution, it gets the same instance (already carrying currentVersion) instead of an empty one.

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Run the unit tests with gradle test to make sure you didn't break anything
  • Add or update any needed documentation to the repo
  • Format the title like "feat: [new feature short description]". Title must follow the Conventional Commit Specification(https://www.conventionalcommits.org/en/v1.0.0/).
  • Linked all relevant issues
  • Include screenshot(s) showing how this pull request works and fixes the issue(s)

@qcdyx qcdyx linked an issue Jan 29, 2026 that may be closed by this pull request
@github-actions
Copy link
Contributor

🚨 Code Formatting Issue 🚨

This contribution does not follow the conventions set by the Google Java Style Guide.

Please run the following command at the root of the project to fix formatting errors:

./gradlew spotlessApply
🗂️ Affected files
  • src/main/java/org/mobilitydata/gtfsvalidator/util/VersionResolver.java

Go to the Actions Dashboard to download the full Spotless output

@github-actions
Copy link
Contributor

🚨 Code Formatting Issue 🚨

This contribution does not follow the conventions set by the Google Java Style Guide.

Please run the following command at the root of the project to fix formatting errors:

./gradlew spotlessApply
🗂️ Affected files
  • src/main/java/org/mobilitydata/gtfsvalidator/util/VersionResolver.java

Go to the Actions Dashboard to download the full Spotless output

@qcdyx qcdyx marked this pull request as ready for review January 29, 2026 18:10
@github-actions
Copy link
Contributor

📝 Acceptance Test Report

📋 Summary

✅ The rule acceptance has passed for commit a41af17
Download the full acceptance test report here (report will disappear after 90 days).

📊 Notices Comparison

New Errors (0 out of 978 datasets, ~0%) ✅

No changes were detected due to the code change.

Dropped Errors (0 out of 978 datasets, ~0%) ✅

No changes were detected due to the code change.

New Warnings (0 out of 978 datasets, ~0%) ✅

No changes were detected due to the code change.

Dropped Warnings (0 out of 978 datasets, ~0%) ✅

No changes were detected due to the code change.

🛡️ Corruption Check

16 out of 994 sources (~2 %) are corrupted.
Dataset Ref Report Exists Ref Report Readable Latest Report Exists Latest Report Readable
mdb-1114
mdb-1123
mdb-1332
mdb-1808
mdb-1953
mdb-227
mdb-383
mdb-55
mdb-606
mdb-609
mdb-655
mdb-780
mdb-789
mdb-806
mdb-9
mdb-907

⏱️ Performance Assessment

📈 Validation Time

Assess the performance in terms of seconds taken for the validation process.

Time Metric Dataset ID Reference (s) Latest (s) Difference (s)
Average -- 5.06 5.19 ⬆️+0.13
Median -- 1.60 1.76 ⬆️+0.17
Standard Deviation -- 14.39 12.97 ⬇️-1.42
Minimum in References Reports mdb-1819 0.48 0.59 ⬆️+0.11
Maximum in Reference Reports mdb-2014 304.71 235.73 ⬇️-68.98
Minimum in Latest Reports mdb-1251 0.48 0.50 ⬆️+0.01
Maximum in Latest Reports mdb-2014 304.71 235.73 ⬇️-68.98
📜 Memory Consumption
Metric Dataset ID Reference (s) Latest (s) Difference (s)
Average -- 565.93 MiB 571.47 MiB ⬆️+5.53 MiB
Median -- 327.93 MiB 327.93 MiB ⬇️0 bytes
Standard Deviation -- 988.25 MiB 1.03 GiB ⬆️+65.86 MiB
Minimum in References Reports mdb-79 39.65 MiB 41.39 MiB ⬆️+1.75 MiB
Maximum in Reference Reports mdb-2393 8.86 GiB 9.47 GiB ⬆️+621.49 MiB
Minimum in Latest Reports mdb-77 415.93 MiB 41.02 MiB ⬇️-374.91 MiB
Maximum in Latest Reports mdb-2014 7.02 GiB 11.89 GiB ⬆️+4.88 GiB

* Keep a reference to the shared in-progress VersionInfo so concurrent callers don't get an empty
* instance.
*/
private volatile VersionInfo inProgressVersionInfo;
Copy link
Member

Choose a reason for hiding this comment

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

I'm not convinced that this will fix the issue. The VersionResolver class is instantiated only once because it's a singleton bean, see. Making the class a singleton and synchronizing the resolve methods ensures that only one thread accesses the resolve method at any given time.

I think the issue is that the web validator makes an HTTP request to retrieve the version. When this HTTP call fails, the version number is returned as null. This is done in the Validator runner called from validateFeed method. If we set skipValidatorUpdate to true in the call, the VersionResolver will not do the HTTP call and the version will be resolved "locally". This will avoid any failures and guarantees that version numbers are consistently available.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll revisit this bug after stop_access schema update and feature addition.

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.

Missing validatorVersion value from GTFS validation report

2 participants