-
Notifications
You must be signed in to change notification settings - Fork 660
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
Fix cloned watcher leaking (#2164) #2175
Fix cloned watcher leaking (#2164) #2175
Conversation
@lwasyl: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/ |
Could you please explain what you need, I can make changes to our existing |
I need something that triggers behavior explained in https://github.com/apollographql/apollo-android/issues/2033, that is:
so if I read correctly, I need two different queries with intersecting The way I reproduced that is by mimicking something we've been hitting internally, where we have a root object for most queries, so whenever we fetch
clear cache and then fetch a different query
then the first query gets refetched. I played with the existing queries and didn't find any pair that triggered this. |
hm, what about:
|
Yep, that works :) I updated the PR |
We are running out of mem :( |
This happens in the gradle plugin tests, right ? I just made it so that gradle is relaunched more often. Hopefully that'll help. In the long run we should investigate with VisualVM see if there's a ClassLoader leak somewhere. I'll create an issue for that. |
We recently increased memory to fix CI issues. With Kotlin Multiplatform we use much more memory now. I'm afraid Gradle tests has their own Gradle instance and has a smaller memory. Adding CLI flag or adding |
* Fork a gradle daemon even more often to try to workaround a MetaSpace error See #2175 (comment) * Fork every test
I wanted to add a test case, but couldn't reproduce it without a schema that has a root object, since apollographql/apollo-kotlin-normalized-cache-incubating#78 wouldn't be triggered. I'm aware the names there aren't ideal, but since I'm not sure if there's a more straightforward way to test I didn't invest time into them. The problem with testing I see is that I don't have a reference to the cloned watcher, so the only observable effect is an additional API call. Is there some other way to trigger refetching of open calls? Anyway, suggestions for testing and/or names are welcome.
I didn't add test for all
toFlow()
variants but applied the same fix. I could try to fit them in a single test case or add a separate test case for each, if needed.