Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set the db application_name after the server row is created #14904

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/models/miq_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ def self.start
Vmdb::Appliance.log_config_on_startup

server.ntp_reload
server.set_database_application_name

EvmDatabase.seed_last

Expand Down Expand Up @@ -459,6 +460,10 @@ def database_application_name
"MIQ #{Process.pid} Server[#{compressed_id}], #{zone.name}[#{zone.compressed_id}]".truncate(64)
end

def set_database_application_name
ArApplicationName.name = database_application_name
end

def is_local?
guid == MiqServer.my_guid
end
Expand Down
9 changes: 0 additions & 9 deletions lib/workers/evm_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ def start

PidFile.create(MiqServer.pidfile)
set_process_title
set_database_application_name
MiqServer.start
rescue Interrupt => e
process_hard_signal(e.message)
Expand All @@ -78,14 +77,6 @@ def set_process_title
Process.setproctitle(SERVER_PROCESS_TITLE) if Process.respond_to?(:setproctitle)
end

def set_database_application_name
ArApplicationName.name = database_application_name
end

def database_application_name
MiqServer.my_server.database_application_name
end

def self.start(*args)
# Parse the args into the global config variable
cfg = {}
Expand Down