[ https://issues.apache.org/jira/browse/DISPATCH-749?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15979961#comment-15979961 ]
ASF GitHub Bot commented on DISPATCH-749: ----------------------------------------- GitHub user pmoravec opened a pull request: https://github.com/apache/qpid-dispatch/pull/160 DISPATCH-749 - unmap_all_addresses unmaps just half of addresses iterating over a list being updated needs deep copy of the list Signed-off-by: Pavel Moravec <pmora...@redhat.com> You can merge this pull request into a Git repository by running: $ git pull https://github.com/pmoravec/qpid-dispatch DISPATCH-749 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/qpid-dispatch/pull/160.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #160 ---- commit 0d052c46da4e3f5faa356d61d22582521cbcb619 Author: Pavel Moravec <pmora...@redhat.com> Date: 2017-04-22T14:44:53Z DISPATCH-749 - unmap_all_addresses unmaps just half of addresses iterating over a list being updated needs deep copy of the list Signed-off-by: Pavel Moravec <pmora...@redhat.com> ---- > unmapping all link-routing addresses leaves half of addresses mapped > -------------------------------------------------------------------- > > Key: DISPATCH-749 > URL: https://issues.apache.org/jira/browse/DISPATCH-749 > Project: Qpid Dispatch > Issue Type: Bug > Components: Router Node > Reporter: Pavel Moravec > Assignee: Pavel Moravec > > Setup: > qpidd < - > qdrouterd(S) < - > qdrouterd(C) < - clients > where clients are link-routing via the qdrouterd network to qpidd. > Under specific situations (see > https://bugzilla.redhat.com/show_bug.cgi?id=1426242 for details), when > qdrouterd(S) is not available for some time, qdrouterd(C) returns > "qd:no-route-to-dest" to its clients - so far so good. > But the error persists even after qdrouterd(S) is up, connected from > qdrouterd(C), all links established and addresses mapped. > The cause is, > https://github.com/apache/qpid-dispatch/blob/master/python/qpid_dispatch_internal/router/node.py#L536-L537 > does _not_ unmap all addresses: > {code} > $ python > Python 2.7.5 (default, Aug 2 2016, 04:20:16) > [GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> mobile_addresses = ['a.', 'b.', 'c.', 'd.'] > >>> for addr in mobile_addresses: > ... mobile_addresses.remove(addr) > ... > >>> print mobile_addresses > ['b.', 'd.'] > >>> > {code} > We can't iterate a list that way while removing items from it. > Trivial fix allows so: > {code} > for addr in mobile_addresses[:]: > {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org