Skip to content

Commit

Permalink
Add listener ready check to process heartbeat
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Foster committed Mar 28, 2013
1 parent 841776a commit b2ed2e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyon/ion/process.py
Expand Up @@ -86,15 +86,15 @@ def heartbeat(self):
Should only be called after the process has been started. Should only be called after the process has been started.
Checks the following: Checks the following:
- All attached endpoints are alive + listening - All attached endpoints are alive + listening (this means ready)
- The control flow greenlet is alive + listening or processing - The control flow greenlet is alive + listening or processing
@return 3-tuple indicating (listeners ok, ctrl thread ok, heartbeat status). Use all on it for a @return 3-tuple indicating (listeners ok, ctrl thread ok, heartbeat status). Use all on it for a
boolean indication of success. boolean indication of success.
""" """
listeners_ok = True listeners_ok = True
for l in self.listeners: for l in self.listeners:
if not (l in self._listener_map and not self._listener_map[l].proc.dead): if not (l in self._listener_map and not self._listener_map[l].proc.dead and l.get_ready_event().is_set()):
listeners_ok = False listeners_ok = False


ctrl_thread_ok = self._ctrl_thread.running ctrl_thread_ok = self._ctrl_thread.running
Expand Down

0 comments on commit b2ed2e1

Please sign in to comment.