def updateCommandWatcher(self, commandWatcher):
        """
        | Send info to the dispatcher about currently running command watcher.
        | Called from the mainloop every time a command has been tagged "modified"
        | req: PUT /rendernodes/<currentRN>/commands/<commandId>/

        :param commandWatcher: the commandWatcher object we will send an update about
        """

        maxRetry = max(1, config.WORKER_REQUEST_MAX_RETRY_COUNT)
        delayRetry = config.WORKER_REQUEST_DELAY_AFTER_REQUEST_FAILURE
        i = 0

        while i < maxRetry:
            url = "/rendernodes/%s/commands/%d/" % (self.computerName, commandWatcher.commandId)
            body = json.dumps(self.buildUpdateDict(commandWatcher.command))
            headers = {'Content-Length': len(body)}

            try:
                self.httpconn.request('PUT', url, body, headers)
                response = self.httpconn.getresponse()
            except httplib.HTTPException, e:
                LOGGER.error('"PUT %s" failed (error:%r)', url, e)
            except socket.error, e:
                LOGGER.error('"PUT %s" failed (error:%r)', url, e)
            except Exception, e:
                LOGGER.info('"PUT %s" failed (unhandled exception: %r', url, e)
            else:
                if response.status == 200:
                    response = response.read()
                    commandWatcher.modified = False
                    break
                elif response.status == 404:
                    LOGGER.warning('removing stale command %d', commandWatcher.commandId)
                    response = response.read()
                    self.removeCommandWatcher(commandWatcher)
                    break
                else:
                    data = response.read()
                    LOGGER.warning("unexpected status %d: %s %s" % (response.status, response.reason, data))
            finally:
                self.httpconn.close()

            LOGGER.warning('Update of command %d failed (attempt %d of %d)', commandWatcher.commandId, i, maxRetry)
            LOGGER.warning('Next retry will occur in %.2f s' % delayRetry)
            time.sleep(delayRetry)
            i += 1
            delayRetry *= 1.5

        # Request error encountered "maxRetry" times, removing the command watcher to avoid
        # recalling this update in next main loop iter
        # if i == maxRetry:
        #     LOGGER.exception('Update of command %d failed repeatedly, removing watcher.', commandWatcher.commandId )
        #     self.removeCommandWatcher(commandWatcher)
dataset/ETHPy150Open mikrosimage/OpenRenderManagement/src/octopus/worker/worker.py/Worker.updateCommandWatcher/original