shunping commented on code in PR #38423:
URL: https://github.com/apache/beam/pull/38423#discussion_r3211045455
##########
sdks/python/apache_beam/runners/portability/job_server.py:
##########
@@ -94,8 +94,14 @@ def start(self):
def stop(self):
with self._lock:
if self._started:
- self._job_server.stop()
- self._started = False
+ try:
+ self._job_server.stop()
+ finally:
+ self._started = False
+ # Unregister the atexit handler to prevent duplicate
+ # registrations when the server is restarted/reused.
+ if hasattr(atexit, 'unregister'):
+ atexit.unregister(self.stop)
Review Comment:
Done,
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]