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

Only clear ASCollectionView's data during deallocation #1154

Conversation

nguyenhuy
Copy link
Member

@nguyenhuy nguyenhuy commented Oct 2, 2018

This is a follow up on #1136. Our experiment results show that clearing data frequently is the cause of our #1 crash. @maicki and I believe that this is because silently clearing its data while the collection view is still being used, without notifying the backing UICollectionView, puts it out-of-sync and causes mayhem next time the collection view processes a batch update. If you look at the stack trace closely, you'll notice that the crash doesn't occur on the same run loop that clearData was called, making it extremely tricky to investigate and identify the root cause.

To fix this problem, I'm proposing to only call clearData if the collection view is actually being torn down. I'm also going to set up another experiment to slowly roll this out to make sure we don't reintroduce the crash, as well as to get insights on whether it's actually worth it. My gut feeling is that it's not, since the data will be autimatically cleared out soon anyway. Please let me know your thoughts.

screen shot 2018-10-01 at 5 08 47 pm

This is a follow up on TextureGroup#1136. Our experiment results show that clearing data frequently is the cause of our TextureGroup#1 crash. @maicki and I believe that this is because if the collection view is being used, silently clearing its data without notifying the backing UICollectionView can put it out-of-sync and causes mayhem next time the collection view processes a batch update. If you look at the stack trace closely, you'll notice that the crash doesn't occur on the same run loop that clearData is called. This made it extremely tricky to investigate and identify the root cause.

Another interesting question would be whether or not we want to clear the data during deallocation at all, since the data will be cleared out soon anyway.
Copy link
Contributor

@maicki maicki left a comment

Choose a reason for hiding this comment

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

LGTM

@maicki
Copy link
Contributor

maicki commented Oct 2, 2018

Will us further looking into fixing: #1155

@nguyenhuy nguyenhuy merged commit e703255 into TextureGroup:master Oct 3, 2018
mikezucc pushed a commit to mikezucc/Texture that referenced this pull request Nov 7, 2018
…1154)

This is a follow up on TextureGroup#1136. Our experiment results show that clearing data frequently is the cause of our #1 crash. @maicki and I believe that this is because if the collection view is being used, silently clearing its data without notifying the backing UICollectionView can put it out-of-sync and causes mayhem next time the collection view processes a batch update. If you look at the stack trace closely, you'll notice that the crash doesn't occur on the same run loop that clearData is called. This made it extremely tricky to investigate and identify the root cause.

Another interesting question would be whether or not we want to clear the data during deallocation at all, since the data will be cleared out soon anyway.
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