From 31b0b2ad58a711e9bf385b12eb54aabe540e4e56 Mon Sep 17 00:00:00 2001 From: Luke Duncalfe Date: Thu, 9 Apr 2020 11:12:46 +1200 Subject: [PATCH] Load GitLabSchema as workaround for errors The errors we see are due to a lack of thread safety. We can remove this workaround when we convert the schema to use the new query interpreter runtime. https://gitlab.com/gitlab-org/gitlab/-/issues/211478#note_320636547 See: - https://gitlab.com/gitlab-org/gitlab/-/issues/211478 - https://gitlab.com/gitlab-org/gitlab/-/issues/210556 --- app/graphql/gitlab_schema.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/graphql/gitlab_schema.rb b/app/graphql/gitlab_schema.rb index 3c996978b6d752..592167a633ba80 100644 --- a/app/graphql/gitlab_schema.rb +++ b/app/graphql/gitlab_schema.rb @@ -144,4 +144,15 @@ def max_query_depth(ctx) end end -GitlabSchema.prepend_if_ee('EE::GitlabSchema') +GitlabSchema.prepend_if_ee('EE::GitlabSchema') # rubocop: disable Cop/InjectEnterpriseEditionModule + +# Force the schema to load as a workaround for intermittent errors we +# see due to a lack of thread safety. +# +# TODO: We can remove this workaround when we convert the schema to use +# the new query interpreter runtime. +# +# See: +# - https://gitlab.com/gitlab-org/gitlab/-/issues/211478 +# - https://gitlab.com/gitlab-org/gitlab/-/issues/210556 +GitlabSchema.graphql_definition -- GitLab