Skip to content

Only clear ASCollectionView's data during deallocation#1154

Merged
nguyenhuy merged 6 commits into
TextureGroup:masterfrom
nguyenhuy:HN-ASCollectionView-Clear-Data-Follow-Up
Oct 3, 2018
Merged

Only clear ASCollectionView's data during deallocation#1154
nguyenhuy merged 6 commits into
TextureGroup:masterfrom
nguyenhuy:HN-ASCollectionView-Clear-Data-Follow-Up

Conversation

@nguyenhuy

@nguyenhuy nguyenhuy commented Oct 2, 2018

Copy link
Copy Markdown
Member

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.

@maicki maicki left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@maicki

maicki commented Oct 2, 2018

Copy link
Copy Markdown
Contributor

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.

2 participants