tkn-tub / veins-gym

Reinforcement Learning-based VANET simulations
https://www2.tkn.tu-berlin.de/software/veins-gym/
GNU General Public License v2.0
53 stars 8 forks source link

Veins could not be killed #4

Closed Anas-1998 closed 2 years ago

Anas-1998 commented 2 years ago

Hello, I am using env.reset() whenever an episode finish, so basically its not a clean shutdown from omnett. I got this output after around 20k episode, is there any specific reason you might know for that? Thanks in advance

WARNING:root:Veins process 972485 did not shut down gracefully, sending kill. ERROR:root:Veins process 972485 could not even be killed!


AssertionError Traceback (most recent call last)

in 67 #for i in range(n_episodes): 68 while(i!=n_episodes): ---> 69 observation = env.reset() 70 done = False 71 score = 0 ~/.local/lib/python3.8/site-packages/gym/wrappers/order_enforcing.py in reset(self, **kwargs) 16 def reset(self, **kwargs): 17 self._has_reset = True ---> 18 return self.env.reset(**kwargs) ~/.local/lib/python3.8/site-packages/veins_gym/__init__.py in reset(self) 233 Waits until first request from veins experiment has been received. 234 """ --> 235 self.close() 236 self.socket = self.context.socket(zmq.REP) 237 if self.port is None: ~/.local/lib/python3.8/site-packages/veins_gym/__init__.py in close(self) 295 if self.veins: 296 # TODO: send shutdown message (which needs to be implemted in veins code) --> 297 shutdown_veins(self.veins) 298 self.veins = None 299 ~/.local/lib/python3.8/site-packages/veins_gym/__init__.py in shutdown_veins(process, gracetime_s) 126 "Veins process %d could not even be killed!", process.pid 127 ) --> 128 assert ( 129 process.poll() and process.returncode is not None 130 ), "Veins could not be killed." AssertionError: Veins could not be killed.
dbuse commented 2 years ago

Hi @Anas-1998

This seems weird. subprocess.Popen.kill() should be able to shut down processes unconditionally. A workaround might be to increase the gracetime_s in Line 101. But I can't comprehend why the process should not be gone after a second.

What platform/OS are you running this on?

Anas-1998 commented 2 years ago

Im working on ubuntu: Distributor ID: Ubuntu Description: Ubuntu 20.04.4 LTS Release: 20.04 Codename: focal I will try to increase the gracetime and let you know if it happend again. Thanks!

dbuse commented 2 years ago

Closing as stale.