Skip to content

Commit

Permalink
Merge pull request #122 from kube-HPC/Enhance_log
Browse files Browse the repository at this point in the history
Enhance error logging
  • Loading branch information
golanha authored Jun 17, 2024
2 parents 7ae296d + ad2290d commit aacc740
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions hkube_python_wrapper/wrapper/algorunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ def _getMethod(self, name):
if (self._algorithm):
return self._algorithm.get(name)
return None

def _init(self, options):
redirector = None
try:
Expand Down Expand Up @@ -345,14 +346,14 @@ def _init(self, options):

def _discovery_update(self, discovery):
log.debug('Got discovery update {discovery}', discovery=discovery)
messageListenerConfig = {'encoding': config.discovery['encoding'],'delay':config.discovery['delay']}
messageListenerConfig = {'encoding': config.discovery['encoding'], 'delay': config.discovery['delay']}
self.streamingManager.setupStreamingListeners(
messageListenerConfig, discovery, self._job.nodeName)

def _setupStreamingProducer(self, nodeName):
def onStatistics(statistics):
thread_list = ""
self._printThread = self._printThread + 1
self._printThread = self._printThread + 1
for thread in threading.enumerate():
thread_list = thread_list + " " + str(thread.name)
if (self._printThread % 30 == 0):
Expand Down Expand Up @@ -492,6 +493,7 @@ def _stopAlgorithm(self, options):
if (self._job and self._job.isStreaming):
if (forceStop is False):
stoppingState = True

def stopping():
while (stoppingState):
self._sendCommand(messages.outgoing.stopping, None)
Expand Down Expand Up @@ -559,7 +561,7 @@ def _sendCommand(self, command, data):

def sendError(self, error):
try:
log.error(error)
log.error("Sending error to worker " + str(error))
self._wsc.send({
'command': messages.outgoing.error,
'error': {
Expand Down

0 comments on commit aacc740

Please sign in to comment.