karthik-0306 opened a new pull request, #41405: URL: https://github.com/apache/beam/pull/41405
Fixes #41404 `_ModelHandlerManager.load` stored a key's tag in `_tag_map` before loading the model. If `load_model()` raised, for example on a transient GCS error, the tag stayed in `_tag_map` with no entry in `_proxy_map`. After that, every `load(key)` returned the stale tag, so the model was reloaded on every batch, and evicting or updating that key failed with `KeyError: '<uuid>'`. This removes the key from `_tag_map` when the load fails, so the next batch loads the model again and it is cached like any other key. Testing: added `test_model_handler_manager_retries_failed_load`, which fails on master and passes with the fix. The `_ModelHandlerManager`, `KeyedModelHandler` and `ModelManagerTest` tests pass. yapf and ruff are clean. R: @damccorm -- 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]
