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

Address some memory hazards in Cython code #5478

Merged
merged 1 commit into from
Mar 1, 2016
Merged

Conversation

soltanmm
Copy link
Contributor

Some __dealloc__ methods were calling Python methods, and some references were being dropped on the floor instead of threaded through gRPC core.

Some __dealloc__ methods were calling Python methods, and some
references were being dropped on the floor instead of threaded through
gRPC core.
self.poll()
event = grpc_completion_queue_next(
self.c_completion_queue, c_deadline, NULL)
self._interpret_event(event)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is self._interpret_event safe to call from inside __dealloc__? And even if it is, what's the point of doing so if its return value is ignored?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_interpret_event is cdef (so it should ostensibly be 'safe' as long as it itself calls no def methods on self) and has side-effects that notify other objects that are subscribed via the tag (e.g. servers).

@nathanielmanistaatgoogle
Copy link
Member

Looks good; merge on test results.

@soltanmm
Copy link
Contributor Author

soltanmm commented Mar 1, 2016

Disappointed that this didn't fix any bugs, but, still necessary. Mergin'.

soltanmm added a commit that referenced this pull request Mar 1, 2016
Address some memory hazards in Cython code
@soltanmm soltanmm merged commit 6a5e1d7 into grpc:master Mar 1, 2016
@soltanmm soltanmm deleted the catatonic branch March 1, 2016 00:55
@nicolasnoble
Copy link
Member

Guys, seriously. I need you to start paying more attention to test results before merging.

image

src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi modified 2016 but copyright only extends to 2015
src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx.pxi modified 2016 but copyright only extends to 2015
src/python/grpcio/grpc/_cython/_cygrpc/server.pxd.pxi modified 2016 but copyright only extends to 2015
src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi modified 2016 but copyright only extends to 2015

@nicolasnoble nicolasnoble mentioned this pull request Mar 1, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Jan 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants