cevi/automatic_walk-time_tables

During a parallel Stress Test the following Exception was thrown

Closed this issue · 2 comments

Known Issue of #88.

I tested all routes/files after another without the issue occurring. Therefore I assume it's caused by an interleaving of multiple requests at the same time. @maede97 we should definitively address that in our new testing framework (i.g. multiple parallel queries to the backend).

[i7ex1 ](https://swarmpit.test.cevi.tools/#/tasks/i7ex1x8dh4mqf4lvmt9vuuqsf?log=1)Traceback (most recent call last):
[i7ex1 ](https://swarmpit.test.cevi.tools/#/tasks/i7ex1x8dh4mqf4lvmt9vuuqsf?log=1)  File "/usr/local/lib/python3.9/threading.py", line 980, in _bootstrap_inner
[i7ex1 ](https://swarmpit.test.cevi.tools/#/tasks/i7ex1x8dh4mqf4lvmt9vuuqsf?log=1)    self.run()
[i7ex1 ](https://swarmpit.test.cevi.tools/#/tasks/i7ex1x8dh4mqf4lvmt9vuuqsf?log=1)  File "/usr/local/lib/python3.9/threading.py", line 917, in run
[i7ex1 ](https://swarmpit.test.cevi.tools/#/tasks/i7ex1x8dh4mqf4lvmt9vuuqsf?log=1)    self._target(*self._args, **self._kwargs)
[i7ex1 ](https://swarmpit.test.cevi.tools/#/tasks/i7ex1x8dh4mqf4lvmt9vuuqsf?log=1)  File "/app/app.py", line 44, in create_export
[i7ex1 ](https://swarmpit.test.cevi.tools/#/tasks/i7ex1x8dh4mqf4lvmt9vuuqsf?log=1)    generator.run()
[i7ex1 ](https://swarmpit.test.cevi.tools/#/tasks/i7ex1x8dh4mqf4lvmt9vuuqsf?log=1)  File "/app/automatic_walk_time_tables/generator.py", line 37, in run
[i7ex1 ](https://swarmpit.test.cevi.tools/#/tasks/i7ex1x8dh4mqf4lvmt9vuuqsf?log=1)    self.__log_runtime(self.__create_files, "Benötigte Zeit für Export")
[i7ex1 ](https://swarmpit.test.cevi.tools/#/tasks/i7ex1x8dh4mqf4lvmt9vuuqsf?log=1)  File "/app/automatic_walk_time_tables/generator.py", line 118, in __log_runtime
[i7ex1 ](https://swarmpit.test.cevi.tools/#/tasks/i7ex1x8dh4mqf4lvmt9vuuqsf?log=1)[INFO] way_points = 20802.897249593105 | distances = 20802.897249593105
[i7ex1 ](https://swarmpit.test.cevi.tools/#/tasks/i7ex1x8dh4mqf4lvmt9vuuqsf?log=1)    results = function(*args, **kwargs)
[i7ex1 ](https://swarmpit.test.cevi.tools/#/tasks/i7ex1x8dh4mqf4lvmt9vuuqsf?log=1)  File "/app/automatic_walk_time_tables/generator.py", line 74, in __create_files
[i7ex1 ](https://swarmpit.test.cevi.tools/#/tasks/i7ex1x8dh4mqf4lvmt9vuuqsf?log=1)    self.__log_runtime(plot_elevation_profile, "Benötigte Zeit zum Zeichnen des Höhenprofils", self.__path,
[i7ex1 ](https://swarmpit.test.cevi.tools/#/tasks/i7ex1x8dh4mqf4lvmt9vuuqsf?log=1)  File "/app/automatic_walk_time_tables/generator.py", line 118, in __log_runtime
[i7ex1 ](https://swarmpit.test.cevi.tools/#/tasks/i7ex1x8dh4mqf4lvmt9vuuqsf?log=1)    results = function(*args, **kwargs)
[i7ex1 ](https://swarmpit.test.cevi.tools/#/tasks/i7ex1x8dh4mqf4lvmt9vuuqsf?log=1)  File "/app/automatic_walk_time_tables/walk_time_table/walk_table.py", line 49, in plot_elevation_profile
[i7ex1 ](https://swarmpit.test.cevi.tools/#/tasks/i7ex1x8dh4mqf4lvmt9vuuqsf?log=1)    plt.scatter([p.accumulated_distance / 1_000.0 for p in way_points.way_points],
[i7ex1 ](https://swarmpit.test.cevi.tools/#/tasks/i7ex1x8dh4mqf4lvmt9vuuqsf?log=1)  File "/usr/local/lib/python3.9/site-packages/matplotlib/pyplot.py", line 2824, in scatter
[i7ex1 ](https://swarmpit.test.cevi.tools/#/tasks/i7ex1x8dh4mqf4lvmt9vuuqsf?log=1)    sci(__ret)
[i7ex1 ](https://swarmpit.test.cevi.tools/#/tasks/i7ex1x8dh4mqf4lvmt9vuuqsf?log=1)  File "/usr/local/lib/python3.9/site-packages/matplotlib/pyplot.py", line 3032, in sci
[i7ex1 ](https://swarmpit.test.cevi.tools/#/tasks/i7ex1x8dh4mqf4lvmt9vuuqsf?log=1)    return gca()._sci(im)
[i7ex1 ](https://swarmpit.test.cevi.tools/#/tasks/i7ex1x8dh4mqf4lvmt9vuuqsf?log=1)  File "/usr/local/lib/python3.9/site-packages/matplotlib/axes/_base.py", line 2155, in _sci
[i7ex1 ](https://swarmpit.test.cevi.tools/#/tasks/i7ex1x8dh4mqf4lvmt9vuuqsf?log=1)    raise ValueError("Argument must be an image, collection, or "
[i7ex1 ](https://swarmpit.test.cevi.tools/#/tasks/i7ex1x8dh4mqf4lvmt9vuuqsf?log=1)ValueError: Argument must be an image, collection, or ContourSet in this Axes

Maybe just add a mutex around plotting the height profile? If there is massive load, other plots must wait, but plotting takes only milliseconds so should be fine.

Seems to be fixed now.