Skip to content
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

fixed refcount leakage when unboxing from cache #196

Merged
merged 1 commit into from
Jul 28, 2017

Conversation

amirmiron
Copy link

There is some leakage of refcounts caused in case of netref realization from cache:

a = remote_object.remote_attr
oid = remote_object.remote_attr.____oid__
oid = remote_object.remote_attr.____oid__
oid = remote_object.remote_attr.____oid__
remote_object.____conn__()._remote_root.exposed_getconn()._local_objects._dict[oid][1]

Would show blowed up refcount.
On unboxing of a reply, if an oid already exists in cache, the same netref is given instead of a new one, causing that we would only one single netref object, that upon its destruction we'd only decref the remote by one, instead of by correct amount. fixed by adding an attribute of refcount on the netref and decref-ing accordingly in a loop.
Another option is to remove the caching altogether but I was unsure as to its importance.
One could also add another parameter for Connection's handle_del and to RefCountingColl.decref to decref not one by one. It could be added as default arguments, or as a different method, or change all other calls to be with a number. Not sure how it might affect others, so didn't do any of that(yet?).

@coldfix
Copy link
Contributor

coldfix commented Jul 26, 2017

Hi,

good catch!

Can you make it work by sending the count as additional argument for _handle_del instead of sending multiple requests.

@coldfix coldfix merged commit f7c2c68 into tomerfiliba-org:master Jul 28, 2017
coldfix added a commit that referenced this pull request Aug 7, 2017
- Fix refcount leakage when unboxing from cache (#196)
- Fix TypeError when dispatching exceptions on py2 (unicode)
- Respect ``rpyc_protocol_config`` for default Service getattr (#202)
- Support unix domain sockets (#100,#208)
- Use first accessible server in ``connect_by_service`` (#220)
- Fix deadlock problem with logging (#207,#212)
coldfix added a commit that referenced this pull request Dec 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants