davsclaus opened a new pull request, #26742:
URL: https://github.com/apache/camel/pull/26742

   Fixes https://issues.apache.org/jira/browse/CAMEL-24899 (part of CAMEL-24886)
   
   CAMEL-24860 restores the previous routes after a failed reload by loading 
the other files again from disk. When the failing file is the only route file, 
there is nothing to restore: the good version is gone from disk, and the app 
runs without routes until the next successful save. Every HTTP example of the 
benchmark is one file, so one bad save took the whole app down for the rest of 
the step and the REST endpoints answered 404.
   
   `RouteWatcherReloadStrategy` now keeps the content of the sources that 
loaded, by location, bounded to the current set (`lastGoodContent`, filled 
after each successful `updateRoutes`). On a failed reload the failed file is 
added back as an in-memory resource with that content and its original 
location, so:
   
   ```
   WARN  RouteWatcherReloadStrategy : Reload failed due to: Error constructing 
YAML node id: pollEnrich: unsupported field: uri
         ... The previous routes were restored (1 route(s) running, 1 from the 
last loaded content of the changed file);
         the changed file loads on its next save
   ```
   
   The file on disk is untouched, and its next save is loaded as usual (the 
in-memory resource carries the same location, so the fixed file replaces it). 
Test: `RouteReloadRollbackTest."the only route file keeps its previous version 
when the save is broken"`, which fails without the change. Verified with `camel 
run --dev` on a single-file project: the timer keeps ticking through the broken 
save, and the fixed save takes over. Upgrade note extended.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_01Bp3538HRBPMQkb5ta9xRaj


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to