Skip to content

Remove ContainerProxy. - #496

Merged
jlaine merged 1 commit into
developfrom
noproxy
Apr 4, 2019
Merged

jlaine merged 1 commit into
developfrom
noproxy

Conversation

@mikeboers

Copy link
Copy Markdown
Member

This was a layer that was once required for garbage collection due to the
cyclic relationships between containers and streams. Newer Cythons seem to deal
with it better.

@mikeboers
mikeboers requested a review from jlaine March 26, 2019 19:48
@mikeboers

Copy link
Copy Markdown
Member Author

Seems like CI is having a hard time with this. But not because the tests are failing, but not finishing.

@mikeboers

Copy link
Copy Markdown
Member Author

So I think the tests are now passing. Unsure if it is because the various CI was having trouble in general, or if this change causes non-deterministic-ish lockups.

@jlaine

jlaine commented Apr 4, 2019

Copy link
Copy Markdown
Member

AppVeyor still looks pretty unhappy!

@jlaine

jlaine commented Apr 4, 2019

Copy link
Copy Markdown
Member

Ah. Looks like this branch needs to be rebased following the flake8 stuff, sorry!

Comment thread av/container/core.pxd Outdated

cdef ContainerProxy proxy
cdef object __weakref__
# cdef object __weakref__

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this line can go :)

@mikeboers

Copy link
Copy Markdown
Member Author

Yeah... they all do. That was my biggest holdup. But I figure if I flake8 them first, it won't be too bad.

Comment thread av/stream.pyx
self.codec_context.stream_index = stream.index

def __dealloc__(self):
if self._codec_options:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice catch, it looks like this was not used at all!

Comment thread av/stream.pxd
# Stream attributes.
cdef ContainerProxy _container
cdef _weak_container
cdef readonly Container container

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm thinking we need some kind of mechanism to break the Container <-> Stream reference loop when the container gets closed, but this can probably be addressed in a separate PR

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I've been looking into overriding the tp_traverse and tp_clear so we can have cycles with __del__ and still deal with it. Not sure if that is something we can actually do, but...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think we could leave the ContainerProxy as a sort of ContainerPointer that only deals with the de-alloc, which would make the code a LOT simpler... if we removed Stream.seek.

(Of the top of my head at least).

@jlaine

jlaine commented Apr 4, 2019

Copy link
Copy Markdown
Member

Yeah... they all do. That was my biggest holdup. But I figure if I flake8 them first, it won't be too bad.

Agreed. Let's get this PR merged next as some others will need refactoring afterwards.

This was a layer that was once required for garbage collection due to the
cyclic relationships between containers and streams. Newer Cythons seem to deal
with it better.
@mikeboers

Copy link
Copy Markdown
Member Author

Just pushed the rebase. That was a LOT easier than I thought it would be. I'm now quite happy we pulled the trigger on that flake8 stuff.

@jlaine
jlaine merged commit fb5c448 into develop Apr 4, 2019
@jlaine
jlaine deleted the noproxy branch April 4, 2019 21:43
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.

2 participants