AWS Thinkbox Discussion Forums

JobExtraInfoKeyValue isn't persisting in event plugin

In my custom even plugin, I’m trying to set a JobExtraInfoKeyValue. If I try to get that value in the same OnJobStarted it returns the value that i set. However, if i try to call it in another function, it doesn’t persist. I’ve verfied that the job id matches up when trying this but cannot figure out why this doesn’t work. Am I misunderstanding SetJobExtraInfoKeyValue ?

Example Code

    def OnJobStarted(self, job):
        self.logger("example job started.")
        self.logger("JobId %s" % str(job.JobId))
        job.SetJobExtraInfoKeyValue("example_str", "0")
        job.GetJobExtraInfoKeyValue("example_str")
        RepositoryUtils.SaveJob(job)
    
    def OnJobFinished(self, job):
        self.logger("example job finished")
        self.logger("JobId %s" % str(job.JobId))
        self.logger("OnJobFinished error_count %s" % job.GetJobExtraInfoKeyValue("example_str"))

No that’s correct - if you look at the job in the Monitor by double clicking it does your ‘example_str’ extra info show up?

If it does the only thing I can think of off hand is if you pull a fresh copy of the job object with RepositoryUtils.GetJob and seeing if it’s an old copy of the job you’re getting for OnJobFinished. But that isn’t what should be happening. Which version of Deadline is this?

It was deadline v10
And Pulling the fresh copy of the job object worked here, thank you!

1 Like

Nice! Could you tell me the whole version number? We’ve been on v10 for a couple years at this point. :slight_smile:

The latest is 10.3.2.1 if you installed a couple days ago.

Privacy | Site terms | Cookie preferences