Repository navigation
Keep the local data file when the update on start-up fails, and register it all the same - #196
Draft
jwrosewell wants to merge 2 commits into
Draft
jwrosewell wants to merge 2 commits into
jwrosewell wants to merge 2 commits into
Conversation
…ter it all the same The specification says a failed update on start-up falls back to the local file, and fails only when there is none. The service returned before it registered the data file, so the file was never polled or watched, and both engine builders turned the error into a failed build, so an application could not start while the update server was unreachable or refusing requests. The service now logs the failure and registers the file all the same, and the builders return the engine, which has already loaded the local file.
This was referenced Oct 27, 2026
Draft
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #165.
Problem
registerreturned the start-up update's error with?(pipeline-engines/src/data_update_service.rsline 171) before it installed the watcher, scheduled the polls or kept the registration, and both engine builders turned that error into a failed build (device-detection-onpremise/src/builder.rslines 247 to 249,ip-intelligence-onpremise/src/builder.rslines 258 to 260). An engine with update on start-up on could not be built while the update server was unreachable or refusing it, although the builder had already loaded the local data file, and a file registered directly was never polled or watched after a failed start-up update.The specification's update on start-up process falls back to the local file when the update fails, and fails only when there is none (data-updates.md lines 266 to 271). Java does this (DataUpdateServiceDefault.java lines 406 to 412). .NET throws instead, which the specification does not ask for. #165 has the details.
Change
registerlogs a failed start-up update as a warning, registers the data file all the same, and then returns the failure, so a caller still learns of it and the updates that follow still run.How it was verified
New tests:
a_failed_update_on_start_up_still_registers_the_data_file(pipeline-engines/tests/update_on_startup.rs) registers a file whose update URL nothing listens on, and checks the error is returned and the file is registered.an_engine_builds_from_its_data_file_when_the_update_on_start_up_fails, indevice-detection-onpremise/tests/update_on_startup.rswith the Lite Hash file and inip-intelligence-onpremise/tests/update_on_startup.rswith the ASN file, builds an engine with update on start-up on and an unreachable update URL, and checks it builds, its file is registered, and it detects or looks up with the local file.Before the change, on a branch holding only the new tests, all three fail.
registerreturns the error with the file unregistered (left: 0, right: 1for the count of registered files), and both engine builders fail, for examplePipelineConfiguration { message: "data update failed (HttpsError): error accessing data update service at 'http://127.0.0.1:54537/download': ..." }. After it, all three pass.Locally on Windows, with all seven fixes of this sweep merged together (#175, #178, #182, #184, #194, #195 and #196),
cargo test --no-fail-fast -p fiftyone-pipeline-engines -p fiftyone-device-detection-onpremise -p fiftyone-ip-intelligence-onpremise -p fiftyone-device-detection -p fiftyone-ip-intelligence -- --nocapture, with51DEGREES_DD_PATHnaming the Lite Hash file,Enterprise-HashV41.hashbeside it, and51DEGREES_IPI_PATHnaming the ASN file,51Degrees-LiteV41.ipibeside it, gives 130 passed, 0 failed and 2 ignored across 24 test binaries. With the fixes merged,cargo doc --workspace --no-depswithRUSTDOCFLAGS="-D warnings"passes, andrustfmt --checkpasses on every file the seven fixes change.cargo clippy --workspace --all-targets -- -D warningson the merged fixes has not run yet. ThePull Requestworkflow, which builds and tests each pull request on every platform, is waiting for approval to run.Behaviour that changes
An engine with update on start-up on now builds from its local data file when the start-up update fails, and the service logs the failure as a warning. A caller of
registerstill gets the error, now with the file registered.What remains
registerlogs carries the error's message, which Keep the licence keys out of the data update errors #175 keeps free of licence keys.