MT#58395 increase session timeouts

* set session wait_timeout to 600 seconds
* in batch mode also the following session vars are set:
  - net_read_timeout = 600
  - net_write_timeout = 600

Change-Id: Ie774f7b5776d07e5c424d0391a5a5ddf4af2d98d
mr12.2
Kirill Solomko 1 year ago
parent b0ddf92a4f
commit 05be63467c

@ -137,8 +137,7 @@ class Config:
_prompt_is_shown: bool = False
_interrupted: bool = False
_not_replicated_was_applied: bool = False
_temp_sql_file: BufferedRandom = \
tempfile.NamedTemporaryFile() # type: ignore
_temp_sql_file: BufferedRandom = None # type: ignore
_run_cmd_mysql_options: List[str] = []
_scripts_dir_order: List[str] = ['init', 'base', 'diff']
@ -404,6 +403,8 @@ def connect_db() -> Connection: # type: ignore
error('unknown database connection scenario')
shutdown(1)
db_conn.query('SET SESSION wait_timeout = 600;')
return db_conn
@ -828,6 +829,16 @@ def apply_revisions(revisions: Revisions) -> None:
if mode == 'down':
dir_specs.reverse()
if config.batch_mode:
config._temp_sql_file = tempfile.NamedTemporaryFile() # type: ignore
config._temp_sql_file.write(
str(
'SET SESSION wait_timeout = 600;\n' +
'SET SESSION net_read_timeout = 600;\n' +
'SET SESSION net_write_timeout = 600;\n'
).encode()
)
for spec in dir_specs:
sorted_revisions = sorted(revisions[spec].keys())
if mode == 'down':

Loading…
Cancel
Save