Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion smdebug/core/state_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ def _read_states_file(self):
"""
if os.path.exists(self._states_file):
with open(self._states_file) as json_data:
parameters = json.load(json_data)
try:
parameters = json.load(json_data)
except json.decoder.JSONDecodeError:
logger.warning(f"{self._states_file} was empty")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not have potential to create a log flood since the str is constant.
Keeping the level=warning since we'd ideally want feedback if this behavior is seen by the customers too often

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open to opinions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In what case would the states file be empty? If it's because of a user misconfiguration of some sort, then yes I agree with making this a warning message. Otherwise, I'm not sure. What are the repercussions for the user if the states file is empty?

return
for param in parameters:
ts_state = dict()
ts_state[TRAINING_RUN] = param[TRAINING_RUN]
Expand Down