rmosolgo / graphql-ruby

Ruby implementation of GraphQL
http://graphql-ruby.org
MIT License
5.38k stars 1.39k forks source link

Process hang during graphql-ruby-client sync with GraphQL::Schema::Visibility #5151

Closed aandrieu closed 1 week ago

aandrieu commented 2 weeks ago

Describe the bug

Hello,

We are using GraphQL Pro with OperationStore. We are also using visible? feature. It used to work fine but when we tried to update to the new visibility system the sync operation (graphql-ruby-client sync) stopped to work.

When we add nothing on our schema: sync works but we have a warning on rails. When we add only use GraphQL::Schema::Warden: sync works and we have no warning. When we add only use GraphQL::Schema::Visibility: sync hangs.

Versions

graphql version: 2.4.2 graphql-pro version: 1.29.2 rails (or other framework): 7.2.2

graphql-ruby-client version: 1.14.1

Steps to reproduce

Hard to find exact steps to reproduce as it hangs in the middle of the process without further infos.

The hang seems to happen after this sql query:

GraphQL::Pro::OperationStore::ActiveRecordBackend::GraphQLOperation Pluck (7.3ms)  SELECT graphql_operations.digest, graphql_operations.id FROM "graphql_operations" WHERE "graphql_operations"."digest" IN (...)

We tried to add migration_errors: true but since it hangs nothing was ever returned :/

Tell me if can provide any other informations that may help you πŸ™

Expected behavior

It should still work as before.

Actual behavior

What specifically went wrong? Process hangs and never stop.

Thank you

rmosolgo commented 2 weeks ago

Hi! Sorry for the trouble and thanks for the detailed report. It sounds like I overlooked a compatibility issue somewhere... I'll take a look and follow up here.

rmosolgo commented 2 weeks ago

I tried to replicate this issue locally, but I couldn't. The best thing to help debug would be a backtrace of the Ruby process while it's hung -- it would tell us what the server is doing that's taking so long (or stuck in a loop). You could do this at least two ways:

Either of those would be really helpful. A couple other debugging ideas:

Let me know what you find and we can keep looking into it! Thanks.

rmosolgo commented 2 weeks ago

πŸ‘‹ Just checking in again about this! I'd love to track down this bug and release a fix. If you don't have time to investigate on your side, I might be able to find it with just a .to_definition print-out of your schema, if you don't mind emailing me one.

aandrieu commented 2 weeks ago

Hello, sorry for the late answer, I will have more time this week.

Regarding the process:

I tried the first point but the server waits for a 'graceful' shutdown when I kill it and seems to never ends. Only force killing it worked but it logged nothing.

So I tried the second point with rbspy and it works perfectly. It seems there is a "loop" on graphql/language/static_visitor.rb:62 that is working just it is very slow.

Output #1 ``` block in find_routes - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/journey/router.rb:134 block in serve - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/journey/router.rb:63 serve - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/routing/mapper.rb:63 block in - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/routing/mapper.rb:33 call - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/endpoint.rb:80 call - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/add_operation_batch.rb:80 transaction - ~/.rbenv/versions/3.3.6/lib/ruby/3.3.0/forwardable.rb:242 transaction - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/active_record_backend.rb:366 transaction - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/activerecord-7.2.2/lib/active_record/transactions.rb:236 with_connection - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/activerecord-7.2.2/lib/active_record/connection_handling.rb:297 with_connection - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/activerecord-7.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:427 block in transaction - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/activerecord-7.2.2/lib/active_record/transactions.rb:235 transaction - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/activerecord-7.2.2/lib/active_record/connection_adapters/abstract/database_statements.rb:365 within_new_transaction - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/activerecord-7.2.2/lib/active_record/connection_adapters/abstract/transaction.rb:645 synchronize - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/activesupport-7.2.2/lib/active_support/concurrency/null_lock.rb:10 block in within_new_transaction - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/activerecord-7.2.2/lib/active_record/connection_adapters/abstract/transaction.rb:644 block in transaction - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/active_record_backend.rb:365 block in call - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/add_operation_batch.rb:66 save! - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/add_operation_batch.rb:200 batch_upsert_client_operations - ~/.rbenv/versions/3.3.6/lib/ruby/3.3.0/forwardable.rb:242 batch_upsert_client_operations - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/active_record_backend.rb:156 map [c function] - (unknown) block in batch_upsert_client_operations - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/active_record_backend.rb:76 validate - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/validate.rb:46 validate - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/validator.rb:65 validate - unknown:44 trace - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/ddtrace-1.23.3/lib/datadog/tracing.rb:19 trace - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/ddtrace-1.23.3/lib/datadog/tracing/tracer.rb:187 skip_trace - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/ddtrace-1.23.3/lib/datadog/tracing/tracer.rb:533 block in validate - unknown:43 validate - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/tracing/trace.rb:29 block in validate - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/validator.rb:59 timeout - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/timeout-0.4.2/lib/timeout.rb:194 block (2 levels) in validate - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/validator.rb:47 catch [c function] - (unknown) block (3 levels) in validate - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/validator.rb:46 visit - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/language/static_visitor.rb:23 public_send [c function] - (unknown) on_document - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/no_definitions_are_present.rb:38 on_document - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fragment_names_are_unique.rb:27 on_document - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fragments_are_finite.rb:18 on_document - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fragments_are_used.rb:29 on_document - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb:38 on_document - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/variables_are_used_and_defined.rb:87 on_document - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/operation_names_are_present_and_unique.rb:41 on_document - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/definition_dependencies.rb:42 on_document - unknown:42 on_document_children - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/language/static_visitor.rb:63 each [c function] - (unknown) block in on_document_children - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/language/static_visitor.rb:62 public_send [c function] - (unknown) on_operation_definition - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/base_visitor.rb:63 block (2 levels) in - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/unique_directives_per_location.rb:28 on_operation_definition - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fields_will_merge.rb:27 on_operation_definition - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fields_have_appropriate_selections.rb:20 on_operation_definition - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/variable_names_are_unique.rb:21 on_operation_definition - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/variables_are_used_and_defined.rb:46 on_operation_definition - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/variable_usages_are_allowed.rb:14 on_operation_definition - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/mutation_root_exists.rb:14 on_operation_definition - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/query_root_exists.rb:14 on_operation_definition - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/subscription_root_exists.rb:14 on_operation_definition - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/operation_names_are_present_and_unique.rb:22 on_operation_definition - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/definition_dependencies.rb:49 on_operation_definition - unknown:42 on_operation_definition_children - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/language/static_visitor.rb:107 visit_selections - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/language/static_visitor.rb:92 each [c function] - (unknown) block in visit_selections - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/language/static_visitor.rb:91 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/base_visitor.rb:94 block (2 levels) in - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/unique_directives_per_location.rb:28 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fields_are_defined_on_type.rb:30 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fields_will_merge.rb:32 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fields_have_appropriate_selections.rb:14 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/required_arguments_are_present.rb:8 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/argument_names_are_unique.rb:10 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/index_visitor.rb:52 on_field - unknown:42 on_field_children - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/language/static_visitor.rb:71 visit_selections - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/language/static_visitor.rb:92 each [c function] - (unknown) block in visit_selections - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/language/static_visitor.rb:91 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/base_visitor.rb:94 block (2 levels) in - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/unique_directives_per_location.rb:28 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fields_are_defined_on_type.rb:30 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fields_will_merge.rb:32 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fields_have_appropriate_selections.rb:14 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/required_arguments_are_present.rb:8 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/argument_names_are_unique.rb:10 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/index_visitor.rb:52 on_field - unknown:42 on_field_children - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/language/static_visitor.rb:71 visit_selections - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/language/static_visitor.rb:92 each [c function] - (unknown) block in visit_selections - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/language/static_visitor.rb:91 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/base_visitor.rb:94 block (2 levels) in - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/unique_directives_per_location.rb:28 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fields_are_defined_on_type.rb:30 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fields_will_merge.rb:32 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fields_have_appropriate_selections.rb:14 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/required_arguments_are_present.rb:8 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/argument_names_are_unique.rb:10 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/index_visitor.rb:52 each_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/index_visitor.rb:112 possible_types - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/schema.rb:641 possible_types - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/schema/visibility/profile.rb:259 block in initialize - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/schema/visibility/profile.rb:123 load_all_types - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/schema/visibility/profile.rb:439 visit_type - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/schema/visibility/profile.rb:507 arguments - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/schema/visibility/profile.rb:232 block in initialize - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/schema/visibility/profile.rb:139 ```
Output #2 ``` block in find_routes - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/journey/router.rb:134 block in serve - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/journey/router.rb:63 serve - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/routing/mapper.rb:63 block in - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/routing/mapper.rb:33 call - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/endpoint.rb:80 call - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/add_operation_batch.rb:80 transaction - ~/.rbenv/versions/3.3.6/lib/ruby/3.3.0/forwardable.rb:242 transaction - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/active_record_backend.rb:366 transaction - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/activerecord-7.2.2/lib/active_record/transactions.rb:236 with_connection - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/activerecord-7.2.2/lib/active_record/connection_handling.rb:297 with_connection - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/activerecord-7.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:427 block in transaction - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/activerecord-7.2.2/lib/active_record/transactions.rb:235 transaction - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/activerecord-7.2.2/lib/active_record/connection_adapters/abstract/database_statements.rb:365 within_new_transaction - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/activerecord-7.2.2/lib/active_record/connection_adapters/abstract/transaction.rb:645 synchronize - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/activesupport-7.2.2/lib/active_support/concurrency/null_lock.rb:10 block in within_new_transaction - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/activerecord-7.2.2/lib/active_record/connection_adapters/abstract/transaction.rb:644 block in transaction - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/active_record_backend.rb:365 block in call - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/add_operation_batch.rb:66 save! - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/add_operation_batch.rb:200 batch_upsert_client_operations - ~/.rbenv/versions/3.3.6/lib/ruby/3.3.0/forwardable.rb:242 batch_upsert_client_operations - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/active_record_backend.rb:156 map [c function] - (unknown) block in batch_upsert_client_operations - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/active_record_backend.rb:76 validate - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/validate.rb:46 validate - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/validator.rb:65 validate - unknown:44 trace - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/ddtrace-1.23.3/lib/datadog/tracing.rb:19 trace - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/ddtrace-1.23.3/lib/datadog/tracing/tracer.rb:187 skip_trace - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/ddtrace-1.23.3/lib/datadog/tracing/tracer.rb:533 block in validate - unknown:43 validate - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/tracing/trace.rb:29 block in validate - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/validator.rb:59 timeout - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/timeout-0.4.2/lib/timeout.rb:194 block (2 levels) in validate - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/validator.rb:47 catch [c function] - (unknown) block (3 levels) in validate - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/validator.rb:46 visit - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/language/static_visitor.rb:23 public_send [c function] - (unknown) on_document - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/no_definitions_are_present.rb:38 on_document - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fragment_names_are_unique.rb:27 on_document - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fragments_are_finite.rb:18 on_document - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fragments_are_used.rb:29 on_document - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb:38 on_document - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/variables_are_used_and_defined.rb:87 on_document - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/operation_names_are_present_and_unique.rb:41 on_document - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/definition_dependencies.rb:42 on_document - unknown:42 on_document_children - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/language/static_visitor.rb:63 each [c function] - (unknown) block in on_document_children - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/language/static_visitor.rb:62 public_send [c function] - (unknown) on_fragment_definition - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/base_visitor.rb:70 on_fragment_with_type - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/base_visitor.rb:182 block in on_fragment_definition - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/base_visitor.rb:69 block (2 levels) in - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/unique_directives_per_location.rb:28 on_fragment_definition - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fragment_names_are_unique.rb:14 on_fragment_definition - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fragments_are_named.rb:13 on_fragment_definition - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fragment_types_exist.rb:9 on_fragment_definition - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fragments_are_on_composite_types.rb:7 on_fragment_definition - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/variables_are_used_and_defined.rb:54 on_fragment_definition - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/index_visitor.rb:34 on_fragment_definition - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/definition_dependencies.rb:56 on_fragment_definition - unknown:42 on_fragment_definition_children - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/language/static_visitor.rb:97 visit_selections - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/language/static_visitor.rb:92 each [c function] - (unknown) block in visit_selections - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/language/static_visitor.rb:91 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/base_visitor.rb:94 block (2 levels) in - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/unique_directives_per_location.rb:28 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fields_are_defined_on_type.rb:30 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fields_will_merge.rb:32 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fields_have_appropriate_selections.rb:14 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/required_arguments_are_present.rb:8 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/argument_names_are_unique.rb:10 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/index_visitor.rb:52 on_field - unknown:42 on_field_children - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/language/static_visitor.rb:71 visit_selections - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/language/static_visitor.rb:92 each [c function] - (unknown) block in visit_selections - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/language/static_visitor.rb:91 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/base_visitor.rb:94 block (2 levels) in - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/unique_directives_per_location.rb:28 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fields_are_defined_on_type.rb:30 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fields_will_merge.rb:32 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fields_have_appropriate_selections.rb:14 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/required_arguments_are_present.rb:8 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/argument_names_are_unique.rb:10 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/index_visitor.rb:52 each_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/index_visitor.rb:112 possible_types - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/schema.rb:641 possible_types - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/schema/visibility/profile.rb:259 block in initialize - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/schema/visibility/profile.rb:123 load_all_types - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/schema/visibility/profile.rb:439 visit_type - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/schema/visibility/profile.rb:507 enum_values - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/schema/visibility/profile.rb:293 block in initialize - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/schema/visibility/profile.rb:131 non_duplicate_items - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/schema/visibility/profile.rb:370 each [c function] - (unknown) block in non_duplicate_items - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/schema/visibility/profile.rb:368 find [c function] - (unknown) each [c function] - (unknown) ```
Output #3 ``` block in find_routes - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/journey/router.rb:134 block in serve - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/journey/router.rb:63 serve - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/routing/mapper.rb:63 block in - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/routing/mapper.rb:33 call - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/endpoint.rb:80 call - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/add_operation_batch.rb:80 transaction - ~/.rbenv/versions/3.3.6/lib/ruby/3.3.0/forwardable.rb:242 transaction - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/active_record_backend.rb:366 transaction - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/activerecord-7.2.2/lib/active_record/transactions.rb:236 with_connection - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/activerecord-7.2.2/lib/active_record/connection_handling.rb:297 with_connection - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/activerecord-7.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:427 block in transaction - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/activerecord-7.2.2/lib/active_record/transactions.rb:235 transaction - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/activerecord-7.2.2/lib/active_record/connection_adapters/abstract/database_statements.rb:365 within_new_transaction - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/activerecord-7.2.2/lib/active_record/connection_adapters/abstract/transaction.rb:645 synchronize - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/activesupport-7.2.2/lib/active_support/concurrency/null_lock.rb:10 block in within_new_transaction - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/activerecord-7.2.2/lib/active_record/connection_adapters/abstract/transaction.rb:644 block in transaction - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/active_record_backend.rb:365 block in call - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/add_operation_batch.rb:66 save! - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/add_operation_batch.rb:200 batch_upsert_client_operations - ~/.rbenv/versions/3.3.6/lib/ruby/3.3.0/forwardable.rb:242 batch_upsert_client_operations - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/active_record_backend.rb:156 map [c function] - (unknown) block in batch_upsert_client_operations - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/active_record_backend.rb:76 validate - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/validate.rb:46 validate - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/validator.rb:65 validate - unknown:44 trace - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/ddtrace-1.23.3/lib/datadog/tracing.rb:19 trace - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/ddtrace-1.23.3/lib/datadog/tracing/tracer.rb:187 skip_trace - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/ddtrace-1.23.3/lib/datadog/tracing/tracer.rb:533 block in validate - unknown:43 validate - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/tracing/trace.rb:29 block in validate - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/validator.rb:59 timeout - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/timeout-0.4.2/lib/timeout.rb:194 block (2 levels) in validate - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/validator.rb:47 catch [c function] - (unknown) block (3 levels) in validate - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/validator.rb:46 visit - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/language/static_visitor.rb:23 public_send [c function] - (unknown) on_document - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/no_definitions_are_present.rb:38 on_document - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fragment_names_are_unique.rb:27 on_document - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fragments_are_finite.rb:18 on_document - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fragments_are_used.rb:29 on_document - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb:38 on_document - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/variables_are_used_and_defined.rb:87 on_document - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/operation_names_are_present_and_unique.rb:41 on_document - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/definition_dependencies.rb:42 on_document - unknown:42 on_document_children - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/language/static_visitor.rb:63 each [c function] - (unknown) block in on_document_children - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/language/static_visitor.rb:62 public_send [c function] - (unknown) on_fragment_definition - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/base_visitor.rb:70 on_fragment_with_type - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/base_visitor.rb:182 block in on_fragment_definition - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/base_visitor.rb:69 block (2 levels) in - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/unique_directives_per_location.rb:28 on_fragment_definition - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fragment_names_are_unique.rb:14 on_fragment_definition - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fragments_are_named.rb:13 on_fragment_definition - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fragment_types_exist.rb:9 on_fragment_definition - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fragments_are_on_composite_types.rb:7 on_fragment_definition - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/variables_are_used_and_defined.rb:54 on_fragment_definition - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/index_visitor.rb:34 on_fragment_definition - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/definition_dependencies.rb:56 on_fragment_definition - unknown:42 on_fragment_definition_children - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/language/static_visitor.rb:97 visit_selections - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/language/static_visitor.rb:92 each [c function] - (unknown) block in visit_selections - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/language/static_visitor.rb:91 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/base_visitor.rb:94 block (2 levels) in - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/unique_directives_per_location.rb:28 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fields_are_defined_on_type.rb:30 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fields_will_merge.rb:32 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/fields_have_appropriate_selections.rb:14 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/required_arguments_are_present.rb:8 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/static_validation/rules/argument_names_are_unique.rb:10 on_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/index_visitor.rb:52 each_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/index_visitor.rb:112 possible_types - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/schema.rb:641 possible_types - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/schema/visibility/profile.rb:259 block in initialize - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/schema/visibility/profile.rb:123 load_all_types - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/schema/visibility/profile.rb:439 visit_type - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/schema/visibility/profile.rb:507 visit_directives - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/schema/visibility/profile.rb:523 directives - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/schema/member/has_directives.rb:38 get_directives - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/schema/member/has_directives.rb:89 get_directives - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/schema/member/has_directives.rb:89 public_send [c function] - (unknown) directives - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/schema/member/has_directives.rb:38 get_directives - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/schema/member/has_directives.rb:89 ```

We have 730+ operations.

On initial sync (starting from clean db):

On delta sync (6 updates including 1 on an operation with a visible?):

On usage: both seems to work fine.

So it just seems that the sync is slow with Visibility and it is not hanging.

We use lot a fragment and based on some investigations it seems that fragments are processed each time they are embedded. Not sure it is expected or should be the case.

Document #1 visit: 1.1478770000394434s ``` fragment surveyAnswerProperties on SurveyAnswer { # ... } mutation UpdateAppSurveyAnswer($content: JSON!) { ...surveyAnswerProperties } ``` ``` on_document on_document_children on_fragment_definition on_fragment_definition_children visit_directives visit_selections on_field on_field_children visit_directives visit_selections on_field on_field_children visit_directives visit_selections on_field on_field_children visit_directives visit_selections on_field on_field_children visit_directives visit_selections on_field on_field_children visit_directives visit_selections on_field on_field_children visit_directives visit_selections on_field on_field_children visit_directives visit_selections on_field on_field_children visit_directives visit_selections on_field on_field_children visit_directives visit_selections on_operation_definition on_operation_definition_children on_variable_definition on_variable_definition on_variable_definition visit_directives visit_selections on_field on_field_children on_argument on_argument_children on_input_object on_argument on_argument_children on_variable_identifier on_argument on_argument_children on_variable_identifier on_argument on_argument_children on_variable_identifier visit_directives visit_selections on_field on_field_children visit_directives visit_selections on_fragment_spread ```
Document #2 (same fragment is re-process) visit: 1.225109999999404 ``` fragment surveyAnswerProperties on SurveyAnswer { # ... } mutation UpdateAppSurveyAnswersReviewStatus($surveyAnswerIds: [ID!]!) { ...surveyAnswerProperties } ``` ``` on_document on_document_children on_fragment_definition on_fragment_definition_children visit_directives visit_selections on_field on_field_children visit_directives visit_selections on_field on_field_children visit_directives visit_selections on_field on_field_children visit_directives visit_selections on_field on_field_children visit_directives visit_selections on_field on_field_children visit_directives visit_selections on_field on_field_children visit_directives visit_selections on_field on_field_children visit_directives visit_selections on_field on_field_children visit_directives visit_selections on_field on_field_children visit_directives visit_selections on_operation_definition on_operation_definition_children on_variable_definition on_variable_definition visit_directives visit_selections on_field on_field_children on_argument on_argument_children on_input_object on_argument on_argument_children on_variable_identifier on_argument on_argument_children on_variable_identifier visit_directives visit_selections on_field on_field_children visit_directives visit_selections on_field on_field_children visit_directives visit_selections on_fragment_spread ```

I will see with our legal team if we can share the schema with you. I will continue to investigate on my side.

aandrieu commented 2 weeks ago

Here are additional infos.

Exemple 1 Operation: ``` mutation ReleaseSurveyLock($id: ID!, $currentLockId: ID) { releaseSurveyLock(input: {id: $id, currentLockId: $currentLockId}) { status } } ``` it takes 0.4s to sync. here it a "trace": ``` visit: 0.40263099991716444s on_document: 0.40250000008381903s on_document_children: 0.4024869999848306s on_operation_definition: 0.4023489998653531s on_operation_definition_children: 0.40232199989259243s visit_selections: 0.29283699998632073s on_field (base visitor): 0.2927840000484139s on_field: 0.19674000004306436s on_field_children: 0.19672199990600348s visit_selections: 0.11706800013780594s on_field (base visitor): 0.11700000008568168s on_field: 6.200000643730164e-05s on_field_children: 5.1999930292367935e-05s visit_selections: 1.1999858543276787e-05s selections: 1.00000761449337e-06s visit_directives: 1.00000761449337e-06s selections: 1.00000761449337e-06s visit_directives: 9.997747838497162e-07s on_argument (base visitor): 0.07961100013926625s on_argument: 0.000547999981790781s on_argument_children: 0.0005189999938011169s on_input_object: 0.0003470000810921192s on_argument (base visitor): 9.099999442696571e-05s on_argument: 2.100015990436077e-05s on_argument_children: 1.300009898841381e-05s on_variable_identifier: 0.0s on_argument (base visitor): 0.0002000001259148121s on_argument: 0.00013699987903237343s on_argument_children: 6.899982690811157e-05s on_variable_identifier: 0.0s selections: 1.00000761449337e-06s visit_directives: 1.00000761449337e-06s on_variable_definition: 0.0s on_variable_definition: 1.00000761449337e-06s ```
Exemple 2 Operation: ``` mutation AssignAppSurveyCard($surveyCardId: ID!, $userId: ID) { assignAppSurveyCard(input: {surveyCardId: $surveyCardId, userId: $userId}) { surveyCard { user { id firstName lastName avatarUrl email } } } } ``` it takes 0.9s to sync. here it a "trace": ``` visit: 0.8853460000827909s on_document: 0.8852869998663664s on_document_children: 0.8852790000382811s on_operation_definition: 0.8851809999905527s on_operation_definition_children: 0.8851739999372512s visit_selections: 0.7955219999421388s on_field (base visitor): 0.7955029997974634s on_field: 0.7094860000070184s on_field_children: 0.7094759999308735s visit_selections: 0.6259260000661016s on_field (base visitor): 0.6259129999671131s on_field: 0.5392109998501837s on_field_children: 0.5392050000373274s visit_selections: 0.5391720000188798s on_field (base visitor): 0.5391569999046624s on_field: 0.4543810000177473s on_field_children: 0.45437399996444583s visit_selections: 0.4542910000309348s on_field (base visitor): 0.09369200002402067s on_field: 5.1999930292367935e-05s on_field_children: 4.2999861761927605e-05s visit_selections: 7.00005330145359e-06s selections: 0.0s visit_directives: 0.0s on_field (base visitor): 0.1002670000307262s on_field: 6.0999998822808266e-05s on_field_children: 5.300017073750496e-05s visit_selections: 1.100008375942707e-05s selections: 1.00000761449337e-06s visit_directives: 1.00000761449337e-06s on_field (base visitor): 0.08967900020070374s on_field: 0.00017699995078146458s on_field_children: 0.00016799988225102425s visit_selections: 8.200015872716904e-05s selections: 1.00000761449337e-06s visit_directives: 0.0s on_field (base visitor): 0.08678500005044043s on_field: 5.4999953135848045e-05s on_field_children: 4.6999892219901085e-05s visit_selections: 8.999835699796677e-06s selections: 1.00000761449337e-06s visit_directives: 1.00000761449337e-06s on_field (base visitor): 0.0838079999666661s on_field: 5.50001859664917e-05s on_field_children: 4.800013266503811e-05s visit_selections: 9.00006853044033e-06s selections: 1.00000761449337e-06s visit_directives: 1.00000761449337e-06s selections: 0.0s visit_directives: 0.0s selections: 0.0s visit_directives: 0.0s selections: 1.00000761449337e-06s visit_directives: 1.00000761449337e-06s on_argument (base visitor): 0.08352400013245642s on_argument: 0.0002210000529885292s on_argument_children: 0.00021199998445808887s on_input_object: 0.0001550000160932541s on_argument (base visitor): 4.400010220706463e-05s on_argument: 1.7999904230237007e-05s on_argument_children: 9.999843314290047e-06s on_variable_identifier: 0.0s on_argument (base visitor): 9.699980728328228e-05s on_argument: 4.5000109821558e-05s on_argument_children: 3.300001844763756e-05s on_variable_identifier: 0.0s selections: 1.00000761449337e-06s visit_directives: 1.00000761449337e-06s on_variable_definition: 0.0s on_variable_definition: 1.00000761449337e-06s ```

It seems some part of base visitor are long vs the static visitior. Some of operations take more 15s for a single operation (involving 50+ fields ; 5/10 fragements)

With warden base visitor seems faster. For instance:

on_field (base visitor): 4.3999869376420975e-05s
 on_field: 2.2999942302703857e-05s
rmosolgo commented 2 weeks ago

This is so helpful -- thank you for sharing so much.

I don't think I need the schema print-out. My first guess was that some part of Schema::Visibility's type definition discovery code was entering an infinite loop. But it sounds like that was wrong!

I'll dig into these examples and see what I can find. I bet there's a codepath in Schema::Visibility that needs to be optimized. (#5154 was a similar issue.)

rmosolgo commented 2 weeks ago

I think the problem is here:

each_field - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-pro-1.29.2/lib/graphql/pro/operation_store/index_visitor.rb:112
possible_types - ~/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/graphql-2.4.2/lib/graphql/schema.rb:64

That codepath creates a new Visibility::Profile each time, which re-traverses the schema. I'm going to improve the implementation in GraphQL-Ruby and update that call in GraphQL-Pro to use a cached-by-default version. (I just double-checked -- the other calls in graphql-pro are already updated.)

aandrieu commented 1 week ago

Top thanks. When you have something ready do not hesitate to ping me if you want me to test your branch against our schema πŸ˜„

rmosolgo commented 1 week ago

Great -- almost there! Thanks again for bringing this issue to my attention.

rmosolgo commented 1 week ago

πŸ‘‹ I just released GraphQL-Pro v1.29.3. Could you try that new version along with the improve-visibility-possible-types branch (#5161)? You can bundle that branch like this:

gem "graphql", github: "rmosolgo/graphql-ruby", ref: "improve-visibility-possible-types"

Let me know how it goes for you! I'm planning to merge and release that branch on Monday.

aandrieu commented 1 week ago

Hello!

I tested the new version with the new schema visibility against our schema: everything worked fine πŸ‘Œ Same performances as before!

Many thanks for this fast response πŸ™‚

rmosolgo commented 1 week ago

Glad to hear it!