Skip to content

Commit 1793b78

Browse files
sfc-gh-stakedaankit-bhatnagar167
authored andcommitted
SNOW-87988: Better handling of OCSP Cache Server Unreachable scenario with proper logging
1 parent d5df638 commit 1793b78

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ocsp_snowflake.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,10 @@ def download_cache_from_server(self, ocsp):
248248
# if any of them is not cache, download the cache file from
249249
# OCSP response cache server.
250250
try:
251-
OCSPServer._download_ocsp_response_cache(ocsp,
251+
retval = OCSPServer._download_ocsp_response_cache(ocsp,
252252
self.CACHE_SERVER_URL)
253+
if not retval:
254+
raise RevocationCheckError(msg="OCSP Cache Server Unavailable.")
253255
logger.debug("downloaded OCSP response cache file from %s",
254256
self.CACHE_SERVER_URL)
255257
logger.debug("# of certificates: %s", len(OCSPCache.CACHE))
@@ -297,6 +299,8 @@ def _download_ocsp_response_cache(ocsp, url, do_retry=True):
297299
logger.error(
298300
"Failed to get OCSP response after %s attempt.",
299301
max_retry)
302+
return False
303+
return True
300304

301305
except Exception as e:
302306
logger.debug("Failed to get OCSP response cache from %s: %s", url,

0 commit comments

Comments
 (0)