mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-04-18 21:44:02 +03:00
fix(CMAPI): reduce timeout value for couple CMAPI endpoints (#3153)
* Minor fix in timeout for /notfound "endpoint" call. - [fix] timeout to urlopen /notfound "endpoint" in mcs-savebrm and mcs-loadbrm * chore(CMAPI): reduced a second Time Out asking MDB for a async replication status. The latency must be small b/c MDB Server to be requested is local. --------- Co-authored-by: drrtuy <drrtuy@gmail.com>
This commit is contained in:
parent
c6b747b7c0
commit
932546f47c
@ -37,7 +37,7 @@ S3_DBROOT1_BRM_PATH = 'data1/systemFiles/dbrm/BRM_saves_current'
|
||||
USER = '@DEFAULT_USER@'
|
||||
GROUP = '@DEFAULT_GROUP@'
|
||||
MINUTE = 60
|
||||
HALF_A_MINUTE = 30
|
||||
FIVE_SECS = 5
|
||||
UNREASONABLE_DELAY = 600
|
||||
LOCALHOST = '127.0.0.1'
|
||||
API_VERSION = '0.4.0'
|
||||
@ -76,7 +76,7 @@ def cmapi_available(host=LOCALHOST):
|
||||
request = Request(method='POST', url=url)
|
||||
ctx = get_unverified_context()
|
||||
try:
|
||||
with urlopen(request, context=ctx, timeout=HALF_A_MINUTE) as req:
|
||||
with urlopen(request, context=ctx, timeout=FIVE_SECS) as req:
|
||||
_ = req.read().decode('utf-8')
|
||||
except HTTPError as exc:
|
||||
if exc.code == 404:
|
||||
@ -165,7 +165,7 @@ def is_node_primary(conf_root):
|
||||
|
||||
success = False
|
||||
try:
|
||||
with urlopen(request, context=ctx, timeout=HALF_A_MINUTE) as req:
|
||||
with urlopen(request, context=ctx, timeout=FIVE_SECS) as req:
|
||||
response = req.read()
|
||||
success = True
|
||||
except HTTPError as exc:
|
||||
|
@ -25,7 +25,7 @@ MCS_BIN_DIR = '@ENGINE_BINDIR@'
|
||||
SAVEBRM = os.path.join(MCS_BIN_DIR, 'save_brm')
|
||||
EM_FILE_SUFFIX = '_em'
|
||||
EM_FILE_SIZE_THRESHOLD = 1000
|
||||
HALF_A_MINUTE = 30
|
||||
FIVE_SECS = 5
|
||||
NUMBER_OF_FILES_TO_KEEP = 40
|
||||
DEFAULT_EM_LOCAL_PATH_PREFIX = ''
|
||||
LOCALHOST = '127.0.0.1'
|
||||
@ -73,7 +73,7 @@ def cmapi_available():
|
||||
request = Request(method='POST', url=url)
|
||||
ctx = get_unverified_context()
|
||||
try:
|
||||
with urlopen(request, context=ctx, timeout=HALF_A_MINUTE) as req:
|
||||
with urlopen(request, context=ctx, timeout=FIVE_SECS) as req:
|
||||
_ = req.read().decode('utf-8')
|
||||
except HTTPError as exc:
|
||||
if exc.code == 404:
|
||||
@ -164,7 +164,7 @@ def is_node_primary(conf_root):
|
||||
|
||||
success = False
|
||||
try:
|
||||
with urlopen(request, context=ctx, timeout=HALF_A_MINUTE) as req:
|
||||
with urlopen(request, context=ctx, timeout=FIVE_SECS) as req:
|
||||
response = req.read()
|
||||
success = True
|
||||
except HTTPError as exc:
|
||||
|
Loading…
x
Reference in New Issue
Block a user