question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DataFetchingFieldSelectionSet updates in 16.1 can't handle recursive schema properly and causing slowness

See original GitHub issue

Describe the bug We are upgrading our library dependency from 15.0 to 16.1 recently and found that DataFetchingFieldSelectionSet updated at https://github.com/graphql-java/graphql-java/pull/2079 has a regression in performance making our HTTP request 10+ times longer.

We use Java Flight Recorder to narrow down the root cause and found that it is because the HashMap.resize() in NormalizedQueryTreeFactory.createNormalizedQueryImpl.

image

Below screenshots show that the normalizedFieldToMergedField has 1.29 M entries and other local variables here also extremely large in size. image

image

To Reproduce Please provide a code example or even better a test to reproduce the bug.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:24 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
ntfcommented, May 12, 2021

@aleksandarsusnjar I think it is related. meanwhile I just downgraded to 15.0 so that I can continue to work on the project.

0reactions
ntfcommented, Jun 28, 2021

Hi @andimarek, sorry for the delay.

It seems the DataFetchingEnvironment#selectionSet() now resolves fields lazily upon accessing environment.getSelectionSet().getFields() and that finishes instantly.

I verified that this fixed my issue originally raised on Feb.

Edit: Got an NPE “java.lang.NullPointerException: null value in entry: viewAs=null” for the below

type XXX {
    owners(viewAs: ID = null): YYYConnection
}

graphql.com.google.common.collect.CollectPreconditions.checkEntryNotNull(CollectPreconditions.java:32) … graphql.com.google.common.collect.ImmutableMap.copyOf(ImmutableMap.java:438) graphql.normalized.NormalizedField$Builder.resolvedArguments(NormalizedField.java:310)

        public Builder resolvedArguments(@Nullable Map<String, Object> arguments) {
            this.resolvedArguments = arguments == null ? ImmutableKit.emptyMap() : ImmutableMap.copyOf(arguments);
            return this;
        }
Read more comments on GitHub >

github_iconTop Results From Across the Web

graphql-java - Bountysource
DataFetchingFieldSelectionSet updates in 16.1 can't handle recursive schema properly and causing slowness $ 0 ... Created 1 year ago in graphql-java/graphql-java ...
Read more >
About the security content of iOS 16.1.1 and iPadOS 16.1.1
This document describes the security content of iOS 16.1.1 and iPadOS ... Recent releases are listed on the Apple security updates page.
Read more >
iOS 16 Problems: 11 Common iPhone Issues and How to Fix ...
From battery issues, to the feeling that an iPhone is hotter than normal, to sluggish performance, problems with installing the update ...
Read more >
Apple iOS 16.1.1 Release: Should You Upgrade? - Forbes
That said, while numerous iOS 16 bugs remain, there are no new deal breakers here. There are some quiet fixes as well (more...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found