Prechádzať zdrojové kódy

HUE-3821 [pig] Logs are never returned on running script

Jenny Kim 9 rokov pred
rodič
commit
b9cffb8

+ 1 - 1
apps/jobbrowser/src/jobbrowser/yarn_models.py

@@ -407,7 +407,7 @@ class Attempt:
 
       # Replace log path tokens with actual container properties if available
       if hasattr(self, 'nodeHttpAddress') and 'nodeId' in attempt:
-        node_url = '%s://%s:%s' % (node_url.split('://')[0], self.nodeHttpAddress.split(':')[0], attempt['nodeId'].split(':')[1])
+        node_url = '%s://%s' % (node_url.split('://')[0], self.nodeHttpAddress)
       container_id = self.assignedContainerId if hasattr(self, 'assignedContainerId') else container_id
 
       log_link = '%(node_url)s/%(logs_path)s/%(container)s/%(user)s' % {

+ 3 - 2
apps/pig/src/pig/api.py

@@ -175,13 +175,14 @@ class OozieApi(object):
       try:
         if action.externalId:
           data = job_single_logs(request, **{'job': action.externalId})
-          if data:
+
+          if data and 'logs' in data:
             matched_logs = self._match_logs(data)
             logs[action.name] = LinkJobLogs._make_links(matched_logs)
             is_really_done = OozieApi.RE_LOG_END.search(data['logs'][1]) is not None
 
       except Exception, e:
-        LOG.error('An error happen while watching the job running: %(error)s' % {'error': e})
+        LOG.error('An error occurred while watching the job running: %(error)s' % {'error': e})
         is_really_done = True
 
     workflow_actions = []