Skip to content

Commit

Permalink
Log exceptions for SSL issues (#242)
Browse files Browse the repository at this point in the history
Fixed to log full tracebacks in daemon threads
  • Loading branch information
szymon-kuklewicz authored Jun 25, 2020
1 parent c6bd436 commit 0b115bf
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ python:
- '3.6'
- '3.7'
- '3.8'

install:
- pip install -r requirements.txt
- pip install -r test_requirements.txt
Expand Down
8 changes: 4 additions & 4 deletions neptune/internal/channels/channels_values_sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ def _process_batch(self):
try:
self._send_values(self._values_batch)
self._values_batch = []
except (NeptuneException, IOError) as e:
_logger.warning('Failed to send channel value: %s', e)
except (NeptuneException, IOError):
_logger.exception('Failed to send channel value.')
self._sleep_time = self._SLEEP_TIME - (time.time() - send_start)

def _send_values(self, queued_channels_values):
Expand Down Expand Up @@ -158,5 +158,5 @@ def get_channel_id(value):
message = e.response.json()["message"]
finally:
_logger.warning('Failed to send channel value: %s', message)
except (NeptuneException, IOError) as e:
_logger.warning('Failed to send channel value: %s', e)
except (NeptuneException, IOError):
_logger.exception('Failed to send channel value.')
4 changes: 2 additions & 2 deletions neptune/internal/threads/hardware_metric_reporting_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ def run(self):

try:
self.__metric_service.report_and_send(timestamp=time.time())
except (NeptuneException, HTTPError) as e:
_logger.debug('Unexpected HTTP error in hardware metric reporting thread: %s', e)
except (NeptuneException, HTTPError):
_logger.exception('Unexpected HTTP error in hardware metric reporting thread.')

reporting_duration = time.time() - before

Expand Down
4 changes: 2 additions & 2 deletions neptune/internal/threads/ping_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ def run(self):
# A 422 error means that we tried to ping the job after marking it as completed.
# In this case, this thread is not needed anymore.
break
except Exception as e:
_logger.debug('Unexpected error in ping thread: %s', e)
except Exception:
_logger.exception('Unexpected error in ping thread.')
self._interrupted.wait(self.PING_INTERVAL_SECS)
3 changes: 1 addition & 2 deletions neptune/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
HTTPInternalServerError, HTTPServerError, HTTPUnauthorized, HTTPServiceUnavailable, HTTPRequestTimeout, \
HTTPGatewayTimeout, HTTPBadGateway

from neptune.api_exceptions import ConnectionLost, Forbidden, ServerError, \
Unauthorized, SSLError
from neptune.api_exceptions import ConnectionLost, Forbidden, ServerError, Unauthorized, SSLError
from neptune.exceptions import InvalidNotebookPath, FileNotFound, NotAFile
from neptune.git_info import GitInfo

Expand Down

0 comments on commit 0b115bf

Please sign in to comment.