accept mr return 500 error when delete source branch was selected
As described in title accept merge request sometimes received error 500, when "delete source branch" was selected.
version: gitlab 9.0
i found log below:
[162646] Started GET "/xxx/xxx/merge_requests/2010?deleted_source_branch=true" for 10.184.193.61 at 2017-06-09 11:43:31 +0800
[162646] Processing by Projects::MergeRequestsController#show as HTML
[162646] Parameters: {"deleted_source_branch"=>"true", "namespace_id"=>"xxx", "project_id"=>"xxx", "id"=>"2010"}
[162646] Completed 500 Internal Server Error in 2625ms (ActiveRecord: 181.9ms)
[162646]
ActionView::Template::Error (Failed to read descriptor: ):
81:
82: = render 'shared/outdated_browser'
83:
84: - if @project && !@project.empty_repo?
85: - if ref = @ref || @project.repository.root_ref
86: :javascript
87: var findFileURL = "#{namespace_project_find_file_path(@project.namespace, @project, ref)}";
lib/gitlab/metrics/instrumentation.rb:156:in `each'
lib/gitlab/metrics/instrumentation.rb:156:in `block in each'
lib/gitlab/metrics/method_call.rb:23:in `measure'
lib/gitlab/metrics/instrumentation.rb:156:in `each'
lib/gitlab/git/repository.rb:94:in `each'
lib/gitlab/git/repository.rb:94:in `map'
lib/gitlab/git/repository.rb:94:in `local_branches'
app/models/repository.rb:917:in `local_branches'
lib/gitlab/metrics/instrumentation.rb:156:in `block in branches'
lib/gitlab/metrics/method_call.rb:23:in `measure'
lib/gitlab/metrics/instrumentation.rb:156:in `branches'
app/models/repository.rb:598:in `branch_count'
lib/gitlab/metrics/instrumentation.rb:156:in `block in _uncached_branch_count'
lib/gitlab/metrics/method_call.rb:23:in `measure'
lib/gitlab/metrics/instrumentation.rb:156:in `_uncached_branch_count'
app/models/repository.rb:49:in `block (2 levels) in cache_method'
lib/repository_cache.rb:20:in `fetch'
app/models/repository.rb:1299:in `cache_method_output'
lib/gitlab/metrics/instrumentation.rb:156:in `block in cache_method_output'
lib/gitlab/metrics/method_call.rb:23:in `measure'
lib/gitlab/metrics/instrumentation.rb:156:in `cache_method_output'
app/models/repository.rb:49:in `block in cache_method'
lib/gitlab/metrics/instrumentation.rb:156:in `block in branch_count'
lib/gitlab/metrics/method_call.rb:23:in `measure'
lib/gitlab/metrics/instrumentation.rb:156:in `branch_count'
And i found many similar errors when i grep the production.log.
it seems like the branches cache was not updated when branch was deleted. However, from the code, we call expire_branches_cache
also before and after branch deleted.
Edited by username-removed-158599