Repository navigation
Say what happens when a data file refresh fails - #60
Merged
Merged
Conversation
A refresh whose new data cannot be used fails and leaves the Engine on the data it had, the failure is logged and reported as a failure, and polling and the file watcher carry on, so a later good file is still applied.
This was referenced Nov 9, 2026
Merged
…eded James Rosewell decided on 10 November that the specification follows .NET's DataUpdateService.cs, which reports each polled check, each programmatic check of a configured data file and each file watcher event to its CheckForUpdateComplete event with a success, not needed or failure status. A new section, Reporting each check, says so, and the polling, newFileAvailable and programmatic update paths point to it.
…one-request packages James Rosewell decided on 10 November that data-updates.md follows the .NET data update service exactly. A programmatic check for a data file with no configuration and an update from memory report nothing, a watcher event that waited for another event for the same file is reported as in progress, and a programmatic failure is passed to the caller without being logged. The polling branch of Programmatic update reports not needed. The Errors table takes .NET's messages, levels and statuses. A package whose processes last for one request, such as PHP's, has no data update service.
This was referenced Nov 10, 2026
jwrosewell
marked this pull request as ready for review
November 11, 2026 07:37
This was referenced Nov 11, 2026
Merged
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.
The data update specification says a background failure is caught and logged, but not what happens to the Engine's data or to later checks when a refresh fails. Each language read that differently, and in three of them a failed refresh ended the process or stopped all later updates, as 51degrees-cxx#61 records. This change states the behavior that the native code and the fixes now provide, and says which checks are reported to the update callbacks and with what status.
What changes in
pipeline-specification/features/data-updates.mdAUTO_UPDATE_SUCCESS).AUTO_UPDATE_NOT_NEEDED), for a 304 (Not modified) response, a downloaded or watched file that is not newer, or a check with no update URL set and no newer file.AUTO_UPDATE_IN_PROGRESS), for a file watcher event that found nothing left to do, being one that waited while another event for the same file was applied, or one from a watcher that does not belong to exactly one registered data file.AUTO_UPDATE_NO_CONFIGURATION), and the other is an update from memory.An unhandled error occurred while checking for automatic updates for engine '<Engine type name>', and on a programmatic check and the update on start-up it passes to the caller. The status was already reported either way. The paragraph above the table says the same. .NET writes no message of its own for this case.The behaviour this records
The failed refresh rules in points 1 to 3 record what the native code and the language fixes already do, with no decision from James Rosewell needed. Points 4 to 7 are his decisions of 10 November. The specification follows the .NET data update service exactly, for reporting and for the error messages and levels ("This is all about alignment."), and PHP is exempt from data updates. 51degrees-cxx 4.5.100 makes a reload that fails keep the data set in use, through 51degrees-cxx#60. GitHub shows that pull request as closed rather than merged, but its commit f4d10614 is on 51degrees-cxx
main. Before that, a reload of a broken file could swap in a half built data set, and the next lookup crashed.How .NET reports and logs each check
At 51degrees-dotnet b3e90b4, its
rcon 10 November,DataUpdateService.csraisesCheckForUpdateCompletewith aDataUpdateCompleteArgsholding the data file and anAutoUpdateStatus.finallyblock ofCheckForUpdate(lines 891 to 921). A check that finds no new data isAUTO_UPDATE_NOT_NEEDED(lines 855 to 858), and so is a 304 response (lines 1374 to 1375). A failure is aDataUpdateExceptioncarrying its status, which thecatchblocks rethrow after setting the status (lines 878 to 889).LogUpdateExceptionand then raises the collected reports (lines 698 to 777).LogUpdateExceptionlogs aDataUpdateExceptionat Error asError during check for data updateand any other exception at Error asAn unhandled error occurred while checking for automatic updates for engine '{0}'(lines 667 to 689, and Messages.resx).CheckForUpdatewith no timer around it, so the failure is reported and then rethrown to the caller, and is not logged. For a data file with no configuration the publicCheckForUpdatereturnsAUTO_UPDATE_NO_CONFIGURATIONwithout raising the event (lines 340 to 363).CheckForUpdatefromRegisterDataFile, which does not catch, so its error reaches the caller. A status other than success or not needed without an error throwsUpdate on startup failed for {0} with status {1}. See log for details(lines 205 to 230).AUTO_UPDATE_IN_PROGRESS(line 549). It is not needed when the file is not newer (line 608), which is checked before the lock and again inside it (lines 565 to 569), so an event that waited for the lock while another event for the same file was applied keepsAUTO_UPDATE_IN_PROGRESS. A file it cannot open within 10 minutes isAUTO_UPDATE_TIMEOUT(line 577). A failure is logged withLogUpdateExceptionand every event is reported (lines 612 to 626).OnUpdateCompleteinvokesCheckForUpdateCompletewith no catch of its own (line 458). On update polling the reports are raised inside atrywhosecatchcallsLogUpdateException(lines 744 to 754), and on the file watcherDataFileUpdateddoes the same (lines 519 to 523), so the error is logged with the last row's message. On a programmatic check and the update on start-up the report is raised in thefinallyofCheckForUpdate(line 917) with nothing around it, so the error passes to the caller.UpdateFromMemoryraises no event. A refresh failure throws aDataUpdateExceptionto the caller, and a failure to write the data file is a warning, after which the Engine is still refreshed (lines 381 to 435).The Errors table takes every message from these lines. Each
DataUpdateExceptionmessage is at line 425, 984, 1012, 1070, 1214, 1314, 1324, 1372, 1382, 1386 and 1461, and the two warnings are at line 406 and line 1357. Two differences are deliberate. The integrity check message in .NET has no space between the quoted Engine type name and "data update", and the table has one. The refresh message fromUpdateFromMemoryends with a full stop and the one from update polling does not, and the table gives the second. The old table's rows for a download error, a write to the data file or temporary file, and a locked file with the temporary file option disabled have no .NET message, so they are gone. Such a failure is logged as any other error.What each package must change
AUTO_UPDATE_REFRESH_FAILEDand schedules the next check whatever happens (datafile_update_service.py lines 297 to 338). The earlier draft pipeline-python#118 was closed with its repository archived.Two of the faults these fix are now ruled out by the text. .NET stopped its update timer after a failed refresh until a restart. Node reported a success straight after a failure.
Review at d8b3a9c, and what changed at 8d43c73 and 95d6c97
The review of d8b3a9c found three MINOR points, fixed in 8d43c73, and the review of 8d43c73 asked that the two rows it added or kept outside .NET follow .NET, done in 95d6c97.
'<Engine type name>'anddata update, because .NET concatenates the two parts with none (lines 1463 and 1464). Every row is therefore .NET's, as the paragraph above the table says.AUTO_UPDATE_IN_PROGRESSwhen an event waited for the lock and then found the file already applied (lines 565 to 569), and when no single data file owns the watcher, because a null data file skips the whole body (line 556) and the report at line 622 still runs. The review also named an event whose file is not newer at the outer check, but that event takes theelseat lines 606 to 609 and reportsAUTO_UPDATE_NOT_NEEDED, which the Not needed bullet already covers, so it is not in the In progress bullet.The callback row (point 8) was added in 8d43c73 with a message .NET does not write, and 95d6c97 changed it to .NET's behaviour and took out the note that two rows differed from .NET. The recheck of 95d6c97 found that a callback's error that is a
DataUpdateExceptionis logged asError during check for data update(lines 673 to 676), and that .NET stops at the first error, so the callbacks after it and the timer's remaining reports are skipped (lines 744 to 754). 176a520 says both in the paragraph above the table, andrcat 96bd70a is merged in.Not changed
The messages at start-up and during operation are unchanged. #55, which masks license keys in the <url> of these messages, has merged into rc, and this branch has it.
How it was checked
The state of each pull request was read from GitHub, and the Python code at the commit linked. rc at 67ead69 is merged into the branch with no conflict, and the diff against rc is only the change above. The .NET lines above were read at b3e90b4, and
DataUpdateService.csis the same at a1454289, the commit the review used. The base is now rc, because the "Only rc into main" check refuses a pull request into main from any branch but rc. There is nothing to build or run in this repository.Outstanding
data update. The table follows .NET as it is, so any fix starts in .NET and the table follows it.this.log('error', e)), not with the last row's message. Python was not read for this row.