mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Acquire a lock regardless of the authentication sources while getting the database server connection.
This commit is contained in:
committed by
Akshay Joshi
parent
9cc2985d13
commit
a7ee4e5909
@@ -25,6 +25,7 @@ from pgadmin.utils import u_encode, file_quote, fs_encoding, \
|
||||
get_complete_file_path, get_storage_directory, IS_WIN
|
||||
from pgadmin.browser.server_groups.servers.utils import does_server_exists
|
||||
from pgadmin.utils.constants import KERBEROS
|
||||
from pgadmin.utils.locker import ConnectionLocker
|
||||
|
||||
import pytz
|
||||
from dateutil import parser
|
||||
@@ -274,14 +275,18 @@ class BatchProcess(object):
|
||||
str(cmd)
|
||||
)
|
||||
|
||||
# Make a copy of environment, and add new variables to support
|
||||
env = os.environ.copy()
|
||||
# Acquiring lock while copying the environment from the parent process
|
||||
# for the child process
|
||||
with ConnectionLocker(_is_kerberos_conn=False):
|
||||
# Make a copy of environment, and add new variables to support
|
||||
env = os.environ.copy()
|
||||
|
||||
env['PROCID'] = self.id
|
||||
env['OUTDIR'] = self.log_dir
|
||||
env['PGA_BGP_FOREGROUND'] = "1"
|
||||
if config.SERVER_MODE and session and \
|
||||
session['auth_source_manager']['current_source'] == \
|
||||
KERBEROS:
|
||||
KERBEROS and 'KRB5CCNAME' in session:
|
||||
env['KRB5CCNAME'] = session['KRB5CCNAME']
|
||||
|
||||
if self.env:
|
||||
|
||||
Reference in New Issue
Block a user