[
https://issues.apache.org/jira/browse/BEAM-10637?focusedWorklogId=466449&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-466449
]
ASF GitHub Bot logged work on BEAM-10637:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 04/Aug/20 21:14
Start Date: 04/Aug/20 21:14
Worklog Time Spent: 10m
Work Description: aaltay commented on a change in pull request #12464:
URL: https://github.com/apache/beam/pull/12464#discussion_r465333885
##########
File path: sdks/python/apache_beam/testing/test_stream_service.py
##########
@@ -50,9 +52,17 @@ def __init__(self, reader, endpoint=None,
exception_handler=None):
self._exception_handler = lambda _: False
def start(self):
- self._server.start()
+ # A server can only be started if never started and never stopped before.
+ if not self._server_started and not self._server_stopped:
+ self._server_started = True
+ self._server.start()
def stop(self):
+ # A server can only be stopped if already started and never stopped before.
+ if not self._server_started or self._server_stopped:
Review comment:
Write this in a format similar to start():
`if self._server_started and not self._server_stopped:`
or change start to similar format as
```
if self._server_started or self._server_stopped:
return
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 466449)
Time Spent: 0.5h (was: 20m)
> Fix start/stop hanging issue on test stream service controller
> --------------------------------------------------------------
>
> Key: BEAM-10637
> URL: https://issues.apache.org/jira/browse/BEAM-10637
> Project: Beam
> Issue Type: Improvement
> Components: runner-py-interactive
> Reporter: Ning Kang
> Assignee: Ning Kang
> Priority: P2
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> The test stream controller sometimes hangs forever when the underlying grpc
> server start or stop in the wrong timing:
> E.g., try to stop a server never started, stop a server already stopped,
> start a server already started and etc.
> The change is to add start/stop states to handle all 6 combinations:
> # start server not started
> # start server started
> # start server stopped
> # stop server not started
> # stop server started
> # stop server stopped
> So that it never hangs.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)