Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress TraCI Error on simulationStep #1770

Merged
merged 2 commits into from
Dec 14, 2022
Merged
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 smarts/core/sumo_traffic_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,11 @@ def _step(self, dt):
# we tell SUMO to step through dt more seconds of the simulation
self._cumulative_sim_seconds += dt
try:
self._traci_conn.simulationStep(self._cumulative_sim_seconds)
# Suppress errors here, to avoid a known (and likely benign)
# error related to removing vehicles.
# See: https://github.com/huawei-noah/SMARTS/issues/1155
with suppress_output(stderr=False):
self._traci_conn.simulationStep(self._cumulative_sim_seconds)
Comment on lines +472 to +473
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is sumo outputting errors on stdout for some reason?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this error is coming through stdout.

Copy link
Collaborator

@Gamenot Gamenot Dec 8, 2022

Choose a reason for hiding this comment

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

Weird. I suppose they consider that it is not crashing. Perhaps it is just reasonable to not output the sumo stdout logs because we have it set to log to a file anyway.

except self._traci_exceptions as e:
self._handle_traci_disconnect(e)
return ProviderState()
Expand Down