-
Notifications
You must be signed in to change notification settings - Fork 898
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b3aa135
commit 266f794
Showing
23 changed files
with
872 additions
and
439 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
# Overwrites the default behavior of puma's thread lock to print the logger | ||
# from ActionDispatch::DebugLocks | ||
# | ||
# Only load if puma is active | ||
# | ||
if defined?(Puma) | ||
Puma::Launcher | ||
|
||
module Puma | ||
class Launcher | ||
private | ||
|
||
def log_thread_status | ||
raw_threads = Thread.list | ||
interlock_share = ActiveSupport::Dependencies.interlock.instance_variable_get(:@lock) | ||
sleeping = interlock_share.instance_variable_get(:@sleeping) | ||
sharing = interlock_share.instance_variable_get(:@sharing) | ||
waiting = interlock_share.instance_variable_get(:@waiting) | ||
exclusive_thread = interlock_share.instance_variable_get(:@exclusive_thread) | ||
|
||
threads = raw_threads.each_with_index.inject({}) do |data, (thread, index)| | ||
purpose, compatible = waiting[thread] | ||
|
||
data[thread] = { | ||
:index => index, | ||
:thread => thread, | ||
:backtrace => thread.backtrace, | ||
:sharing => sharing[thread], | ||
:exclusive => exclusive_thread == thread, | ||
:purpose => purpose, | ||
:compatible => compatible, | ||
:waiting => !!waiting[thread], | ||
:sleeper => sleeping[thread] | ||
} | ||
|
||
data | ||
end | ||
|
||
threads.each do |thread, info| | ||
if info[:exclusive] | ||
lock_state = +"Exclusive" | ||
elsif info[:sharing] > 0 | ||
lock_state = +"Sharing" | ||
lock_state << " x#{info[:sharing]}" if info[:sharing] > 1 | ||
else | ||
lock_state = +"No lock" | ||
end | ||
|
||
if info[:waiting] | ||
lock_state << " (yielded share)" | ||
end | ||
|
||
thread_header = "0x#{thread.__id__.to_s(16)} " | ||
thread_header << "'#{info[:thread]['label']}' " | ||
thread_header << "#{thread.status || 'dead'} " | ||
|
||
puts +"Thread #{info[:index]} [#{thread_header}] #{lock_state}" | ||
|
||
if info[:sleeper] | ||
print " Waiting in #{info[:sleeper]}" | ||
print " to #{info[:purpose].to_s.inspect}" unless info[:purpose].nil? | ||
puts | ||
|
||
if info[:compatible] | ||
compat = info[:compatible].map { |c| c == false ? "share" : c.to_s.inspect } | ||
puts " may be pre-empted for: #{compat.join(', ')}" | ||
end | ||
|
||
blockers = threads.values.select { |binfo| blocked_by?(info, binfo, threads.values) } | ||
puts " blocked by: #{blockers.map { |i| i[:index] }.join(', ')}" if blockers.any? | ||
end | ||
|
||
blockees = threads.values.select { |binfo| blocked_by?(binfo, info, threads.values) } | ||
puts " blocking: #{blockees.map { |i| i[:index] }.join(', ')}" if blockees.any? | ||
|
||
puts "#{info[:backtrace].join("\n")}\n" if info[:backtrace] | ||
puts "\n\n---\n\n\n" | ||
end | ||
end | ||
|
||
def blocked_by?(victim, blocker, all_threads) | ||
return false if victim.equal?(blocker) | ||
|
||
case victim[:sleeper] | ||
when :start_sharing | ||
blocker[:exclusive] || | ||
(!victim[:waiting] && blocker[:compatible] && !blocker[:compatible].include?(false)) | ||
when :start_exclusive | ||
blocker[:sharing] > 0 || | ||
blocker[:exclusive] || | ||
(blocker[:compatible] && !blocker[:compatible].include?(victim[:purpose])) | ||
when :yield_shares | ||
blocker[:exclusive] | ||
when :stop_exclusive | ||
blocker[:exclusive] || | ||
victim[:compatible] && | ||
victim[:compatible].include?(blocker[:purpose]) && | ||
all_threads.all? { |other| !other[:compatible] || blocker.equal?(other) || other[:compatible].include?(blocker[:purpose]) } | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
[1].execute => | ||
[1].launch_ansible_job => | ||
[2].create_job (.create_stack) => | ||
[2].raw_create_stack => | ||
[3].run => | ||
[4][5].create_job => | ||
[4][6].signal => | ||
... => | ||
[5].execute | ||
[5].launch_runner | ||
[7].run_async | ||
|
||
|
||
[1]: ServiceAnsiblePlaybook (app/models/service_ansible_playbook.rb) | ||
[2]: ManageIQ::Providers::EmbeddedAnsible::AutomationManager::Job (app/models/manageiq/providers/embedded_ansible/automation_manager/job.rb) | ||
[3]: ManageIQ::Providers::EmbeddedAnsible::AutomationManager::Playbook (app/models/manageiq/providers/embedded_ansible/automation_manager/playbook.rb) | ||
[4]: ManageIQ::Providers::AnsiblePlaybookWorkflow (app/models/manageiq/providers/ansible_playbook_workflow.rb) | ||
[5]: ManageIQ::Providers::AnsibleRunnerWorkflow (app/models/manageiq/providers/ansible_runner_workflow.rb) | ||
[6]: Job (app/models/job.rb) | ||
[7]: Ansible::Runner (lib/ansible/runner.rb) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
web: | ||
image: 'gitlab/gitlab-ee:latest' | ||
restart: always | ||
hostname: 'gitlab.example.com' | ||
environment: | ||
GITLAB_OMNIBUS_CONFIG: | | ||
external_url 'https://gitlab.example.com' | ||
# Add any other gitlab.rb configuration here, each on its own line | ||
ports: | ||
- '80:80' | ||
- '443:443' | ||
- '22:22' | ||
volumes: | ||
- '$GITLAB_HOME/config:/etc/gitlab' | ||
- '$GITLAB_HOME/logs:/var/log/gitlab' | ||
- '$GITLAB_HOME/data:/var/opt/gitlab' |
Oops, something went wrong.