twisted / twisted/twisted

RemoteCacheObserver attempts to compare pb.Broker, which is not comparable

Open
#9,671 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug new pb priority-normal
Dominant language
Python
Stars
6k
Forks
1.2k
Avg merge
2d 10h
Merged PRs (30d)
10

Description

moko879's avatar @moko879 reported
Trac ID trac#9671
Type defect
Created 2019-07-11 03:10:08Z

In RemoteCacheObserver.cmp, you attempt to compare the brokers of the two observers. This triggers an error:
*** TypeError: '<' not supported between instances of 'Broker' and 'Broker'
Since Broker doesn't support comparison.

In my case, I'm trying to track observers in a Cacheable object and clean them up on calls to stoppedObserving. This is the same pattern laid out in the tutorial for Cacheable. It works fine if I'm only shared the Cacheable with a single client, but when I'm sharing it with more than 1 I get this error when any of them disconnect.

Searchable metadata
trac-id__9671 9671
type__defect defect
reporter__moko879 moko879
priority__normal normal
milestone__None None
branch__ 
branch_author__ 
status__new new
resolution__None None
component__pb pb
keywords__None None
time__1562814608500429 1562814608500429
changetime__1562817536044248 1562817536044248
version__None None
owner__None None

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at RemoteCacheObserver.cmp and inspect how it compares brokers while Cacheable tracks observers through stoppedObserving. Reproduce the failure with multiple clients disconnecting; done means observer cleanup no longer raises a TypeError when brokers are compared.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.