Commit f061049f authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Fix git access denied errors when using Spring

When allowing git disk access, we call
Gitlab::GitalyClient::StorageSettings.allow_disk_access which tracks
this using a class instance variable.

When classes are unloaded by Spring, we still keep a stale
instance of Gitlab::GitalyClient::StorageSettings in Gitlab.config.
And when self.class.disk_access_denied? is called on that instance, it
was checking the class instance variable of the stale class.

We fix this by using
Gitlab::GitalyClient::StorageSettings.disk_access_denied? so that both
of them use the same class instance variable.
parent bb13a881
......@@ -60,7 +60,8 @@ module Gitlab
end
def legacy_disk_path
if self.class.disk_access_denied?
# Do not use self.class due to Spring reloading issues
if Gitlab::GitalyClient::StorageSettings.disk_access_denied?
raise DirectPathAccessError, "git disk access denied"
end
......
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