Commit 0720b9ce authored by Ahmad Sherif's avatar Ahmad Sherif

Catch what warden might throw when profiling requests to re-throw it

Closes #20488
parent 0819461e
......@@ -44,6 +44,7 @@ v 8.11.0 (unreleased)
- Reduce number of queries made for merge_requests/:id/diffs
- Sensible state specific default sort order for issues and merge requests !5453 (tomb0y)
- Fix RequestProfiler::Middleware error when code is reloaded in development
- Catch what warden might throw when profiling requests to re-throw it
v 8.10.3 (unreleased)
- Fix importer for GitHub Pull Requests when a branch was removed
......
......@@ -29,7 +29,9 @@ module Gitlab
def call_with_profiling(env)
ret = nil
result = RubyProf::Profile.profile do
ret = @app.call(env)
ret = catch(:warden) do
@app.call(env)
end
end
printer = RubyProf::CallStackPrinter.new(result)
......@@ -41,7 +43,11 @@ module Gitlab
printer.print(file)
end
if ret.is_a?(Array)
ret
else
throw(:warden, ret)
end
end
end
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