-
Notifications
You must be signed in to change notification settings - Fork 1.7k
application: on plugin load failure, log and continue #3486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Summary: Prior to this change, any exception raised from `loader.load()` would crash TensorBoard (see, e.g., #3484). As of this patch, we log an error, drop the plugin, and continue loading. Test Plan: Run `bazel run //tensorboard -- --logdir /tmp/logs` in a virtualenv with `tensorboard-plugin-wit==1.6.0.post3` but *without* the patch in #3485. Note that TensorBoard now prints: ``` E0406 09:57:12.844471 139872056727360 application.py:260] Failed to invoke plugin loader WhatIfToolPluginLoader.load Traceback (most recent call last): File ".../tensorboard/backend/application.py", line 255, in TensorBoardWSGIApp plugin = loader.load(context) File "/VIRTUAL_ENV/lib/python3.7/site-packages/tensorboard_plugin_wit/wit_plugin_loader.py", line 51, in load version = pkg_resources.parse_version(tensorboard.__version__) AttributeError: module 'tensorboard' has no attribute '__version__' Serving TensorBoard on localhost; to expose to the network, use a proxy or pass --bind_all TensorBoard 2.3.0a0 at http://localhost:6006/ (Press CTRL+C to quit) ``` wchargin-branch: application-load-failure-robustness
|
The |
tensorboard/backend/application.py
Outdated
| plugin = loader.load(context) | ||
| except Exception: | ||
| logger.error( | ||
| "Failed to invoke plugin loader %s", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this supposed to be user visible error string? Not sure how much user cares about "invoking plugin loader". I think it should say something like "Failed to load plugin %s and ignoring it".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it’s user-facing, and you’re right, it should be improved. Took
your wording; thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(It’s slightly awkward because the actual plugin name is given by the
result of load, so all we have is the qualname of the loader itself,
but hopefully “WhatIfToolPluginLoader.load” is clear enough.)
wchargin-branch: application-load-failure-robustness wchargin-source: 368ea5aaa168d2972631207ea3740443cbbf1a43
wchargin-branch: application-load-failure-robustness wchargin-source: 368ea5aaa168d2972631207ea3740443cbbf1a43
Summary: Prior to this change, any exception raised from `loader.load()` would crash TensorBoard (see, e.g., tensorflow#3484). As of this patch, we log an error, drop the plugin, and continue loading. Test Plan: Run `bazel run //tensorboard -- --logdir /tmp/logs` in a virtualenv with `tensorboard-plugin-wit==1.6.0.post3` but *without* the patch in tensorflow#3485 (i.e., run `git revert e59e9c4`). Note that TensorBoard now prints: ``` E0406 11:00:39.494363 140089282381632 application.py:260] Failed to load plugin WhatIfToolPluginLoader.load; ignoring it. Traceback (most recent call last): File ".../tensorboard/backend/application.py", line 255, in TensorBoardWSGIApp plugin = loader.load(context) File "/VIRTUAL_ENV/lib/python3.7/site-packages/tensorboard_plugin_wit/wit_plugin_loader.py", line 51, in load version = pkg_resources.parse_version(tensorboard.__version__) AttributeError: module 'tensorboard' has no attribute '__version__' Serving TensorBoard on localhost; to expose to the network, use a proxy or pass --bind_all TensorBoard 2.3.0a0 at http://localhost:6006/ (Press CTRL+C to quit) ``` wchargin-branch: application-load-failure-robustness
Summary: Prior to this change, any exception raised from `loader.load()` would crash TensorBoard (see, e.g., #3484). As of this patch, we log an error, drop the plugin, and continue loading. Test Plan: Run `bazel run //tensorboard -- --logdir /tmp/logs` in a virtualenv with `tensorboard-plugin-wit==1.6.0.post3` but *without* the patch in #3485 (i.e., run `git revert e59e9c4`). Note that TensorBoard now prints: ``` E0406 11:00:39.494363 140089282381632 application.py:260] Failed to load plugin WhatIfToolPluginLoader.load; ignoring it. Traceback (most recent call last): File ".../tensorboard/backend/application.py", line 255, in TensorBoardWSGIApp plugin = loader.load(context) File "/VIRTUAL_ENV/lib/python3.7/site-packages/tensorboard_plugin_wit/wit_plugin_loader.py", line 51, in load version = pkg_resources.parse_version(tensorboard.__version__) AttributeError: module 'tensorboard' has no attribute '__version__' Serving TensorBoard on localhost; to expose to the network, use a proxy or pass --bind_all TensorBoard 2.3.0a0 at http://localhost:6006/ (Press CTRL+C to quit) ``` wchargin-branch: application-load-failure-robustness
Summary:
Prior to this change, any exception raised from
loader.load()wouldcrash TensorBoard (see, e.g., #3484). As of this patch, we log an error,
drop the plugin, and continue loading.
Test Plan:
Run
bazel run //tensorboard -- --logdir /tmp/logsin a virtualenv withtensorboard-plugin-wit==1.6.0.post3but without the patch in #3485(i.e., run
git revert e59e9c4f376a). Note that TensorBoard now prints:wchargin-branch: application-load-failure-robustness