Commit 9f4d8402 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Eager load http-cookie to avoid thread-safety bug

Without this sometimes we can see this error while running for the
first few requests:

    ArgumentError:
      cookie store unavailable: :hash

That's because http-cookie is not loading the store in a thread-safe
way.

See: https://gitlab.com/gitlab-org/gitlab/issues/207937
parent e2a39353
# frozen_string_literal: true
# https://gitlab.com/gitlab-org/gitlab/issues/207937
# http-cookie is not thread-safe while loading it the first time, see:
# https://github.com/sparklemotion/http-cookie/issues/6#issuecomment-543570876
# If we're using it, we should eagerly load it.
# For now, we have an implicit dependency on it via:
# * http
# * rest-client
require 'http/cookie_jar/hash_store' if Gem.loaded_specs.key?('http-cookie')
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment