Repository navigation
Detect a channel whose own component disappeared on reconnect - #40
Closed
drHouse-gif wants to merge 1 commit into
Closed
drHouse-gif wants to merge 1 commit into
drHouse-gif wants to merge 1 commit into
Conversation
_reinit_channel_and_handlers compared only capability names, so a device that
comes back with fewer instances of the same component went unnoticed: two
switches becoming one leaves the capability set as {switch}, and both the
"capability removed" and "capability added" checks see nothing to do.
The orphaned channel therefore kept its dbus service and was refreshed against a
component that no longer answers, so Switch.GetStatus for the missing id returned
None and the handler's refresh raised
TypeError: 'NoneType' object is not subscriptable.
Also compare the channel's own component ids against the freshly enumerated ones
and take the existing "capabilities changed" route when none of them is left. An
aggregated channel (several ids on one service) survives as long as one of its
ids remains.
As with any capability change this disables every channel of the device and lets
discovery re-inventory it, rather than tearing down just the orphan; a more
surgical teardown would mean reworking the channel bookkeeping in discovery.py.
Removes the xfail marker on test_channel_count_change_within_reconnect_loop and
extends it to check that the device recovers: the remaining component is
re-inventoried, can be enabled again and still switches. The test fails on the
unpatched driver.
Collaborator
Author
|
Closing as a duplicate. #30 carries the same change and already merges cleanly onto master, so this adds nothing. Sorry for the noise. |
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.
_reinit_channel_and_handlers compared only capability names, so a device that comes back with fewer instances of the same component went unnoticed: two switches becoming one leaves the capability set as {switch}, and both the "capability removed" and "capability added" checks see nothing to do.
The orphaned channel therefore kept its dbus service and was refreshed against a component that no longer answers, so Switch.GetStatus for the missing id returned None and the handler's refresh raised
TypeError: 'NoneType' object is not subscriptable.
Also compare the channel's own component ids against the freshly enumerated ones and take the existing "capabilities changed" route when none of them is left. An aggregated channel (several ids on one service) survives as long as one of its ids remains.
As with any capability change this disables every channel of the device and lets discovery re-inventory it, rather than tearing down just the orphan; a more surgical teardown would mean reworking the channel bookkeeping in discovery.py.
Removes the xfail marker on test_channel_count_change_within_reconnect_loop and extends it to check that the device recovers: the remaining component is re-inventoried, can be enabled again and still switches. The test fails on the unpatched driver.