Skip to content

Commit 372a5e4

Browse files
committed
aviod logging connection OSError as SSL error
other sources of OSError should be fatal (e.g. 'cannot assign requested address')
1 parent 2289b96 commit 372a5e4

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

jupyterhub_traefik_proxy/proxy.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,12 +378,23 @@ async def _check_traefik_static_conf_ready():
378378
# unexpected
379379
self.log.error(f"Error checking for traefik static configuration {e}")
380380
return False
381-
except (OSError, ssl.SSLError) as e:
381+
except ssl.SSLError as e:
382382
# Can occur if SSL isn't set up yet
383383
self.log.warning(
384384
f"SSL Error checking for traefik static configuration: {e}"
385385
)
386386
return False
387+
except OSError as e:
388+
# OSError can occur during SSL setup,
389+
# e.g. if socket is listening, but SSL isn't ready
390+
if self.traefik_api_url.startswith("https:"):
391+
self.log.warning(
392+
f"Error checking for traefik static configuration: {e}"
393+
)
394+
return False
395+
else:
396+
# other OSErrors should be fatal
397+
raise
387398

388399
return True
389400

0 commit comments

Comments
 (0)