Example #1
0
    def _try_write_meta_key(self, session):
        s = session.clone()
        s.add_groups([self.group])
        _, failed_groups = helpers.write_retry(
            s,
            keys.SYMMETRIC_GROUPS_KEY,
            msgpack.packb(self.metakey),
            retries=1,
        )
        if failed_groups:
            logger.error(
                'Job {job_id}, task {task_id}: failed to write metakey to group {group}'.format(
                    job_id=self.parent_job.id,
                    task_id=self.id,
                    group=self.group,
                )
            )
        else:
            logger.debug(
                'Job {job_id}, task {task_id}: metakey is successfully written '
                'to group {group}'.format(
                    job_id=self.parent_job.id,
                    task_id=self.id,
                    group=self.group,
                )
            )

        return not failed_groups
    def _try_write_meta_key(self, session):
        s = session.clone()
        s.add_groups([self.group])
        _, failed_groups = helpers.write_retry(
            s,
            keys.SYMMETRIC_GROUPS_KEY,
            msgpack.packb(self.metakey),
            retries=1,
        )
        if failed_groups:
            logger.error(
                'Job {job_id}, task {task_id}: failed to write metakey to group {group}'
                .format(
                    job_id=self.parent_job.id,
                    task_id=self.id,
                    group=self.group,
                ))
        else:
            logger.debug(
                'Job {job_id}, task {task_id}: metakey is successfully written '
                'to group {group}'.format(
                    job_id=self.parent_job.id,
                    task_id=self.id,
                    group=self.group,
                ))

        return not failed_groups
Example #3
0
 def unmark_groups(self, session):
     for group_id, updated_meta in self._group_unmarks():
         s = session.clone()
         s.set_groups([group_id])
         packed = msgpack.packb(updated_meta)
         _, failed_group = h.write_retry(
             s, keys.SYMMETRIC_GROUPS_KEY, packed)
         if failed_group:
             logger.error('Job {0}: failed to unmark group {1}'.format(
                 self.id, group_id))
Example #4
0
 def unmark_groups(self, session):
     for group_id, updated_meta in self._group_unmarks():
         s = session.clone()
         s.set_groups([group_id])
         packed = msgpack.packb(updated_meta)
         _, failed_group = h.write_retry(s, keys.SYMMETRIC_GROUPS_KEY,
                                         packed)
         if failed_group:
             logger.error('Job {0}: failed to unmark group {1}'.format(
                 self.id, group_id))