Skip to content

Commit

Permalink
update request2 timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
wguanicedew committed Sep 25, 2024
1 parent 128ebe4 commit 62361b1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pilot/control/payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ def get_logging_info(job: JobData, args: object) -> dict:
logger.info("correct logserver formal: logging_type;protocol://hostname:port")
return {}

regex = r"logserver='(?P<logging_type>[^;]+);(?P<protocol>[^:]+)://(?P<hostname>[^:]+):(?P<port>\d+)'"
regex = r"logserver=(?P<logging_type>[^;]+);(?P<protocol>[^:]+)://(?P<hostname>[^:]+):(?P<port>\d+)"
match = search(regex, logserver)
if match:
logging_type = match.group('logging_type')
Expand Down
3 changes: 2 additions & 1 deletion pilot/util/https.py
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,8 @@ def request2(url: str = "",
# Send the request securely
try:
logger.debug('sending data to server')
with urllib.request.urlopen(req, context=ssl_context, timeout=30) as response:
timeout = int(config.Pilot.http_maxtime)
with urllib.request.urlopen(req, context=ssl_context, timeout=timeout) as response:
# Handle the response here
logger.debug(f"response.status={response.status}, response.reason={response.reason}")
ret = response.read().decode('utf-8')
Expand Down

0 comments on commit 62361b1

Please sign in to comment.