)]}'
{"freezer/scheduler/scheduler_job.py":[{"author":{"_account_id":28619,"name":"Dmitriy Rabotyagov","email":"noonedeadpunk@gmail.com","username":"noonedeadpunk"},"change_message_id":"c398e9d197be6b480e28d766332845c7c6746df4","unresolved":true,"context_lines":[{"line_number":384,"context_line":""},{"line_number":385,"context_line":"    def process_event(self, job_doc):"},{"line_number":386,"context_line":"        with self.scheduler.lock:"},{"line_number":387,"context_line":"            # Unconditionally: a job with no pending event never enters the"},{"line_number":388,"context_line":"            # loop below and would otherwise never see the update."},{"line_number":389,"context_line":"            schedule_changed \u003d self.refresh_job_doc(job_doc)"},{"line_number":390,"context_line":""},{"line_number":391,"context_line":"            next_event \u003d job_doc[\u0027job_schedule\u0027].get(\u0027event\u0027, \u0027\u0027)"},{"line_number":392,"context_line":"            # Re-arming a running job would churn its state mid-execution;"}],"source_content_type":"text/x-python","patch_set":2,"id":"1817ae76_3dd220a7","line":389,"range":{"start_line":387,"start_character":0,"end_line":389,"end_character":60},"updated":"2026-08-20 13:46:18.000000000","message":"I am really not sure I like this part. It will create quite some pressure on API, and it also terribly scales.\nGiven we have 1000 jobs, that run each hour, we will be doing 3000 API requests each minute, because tick is unrelated to job schedule, if I understand this right? \n\nMoreover, it is blocking operation, so job will be waiting for API response on each tick, which can result in dragging latency.\n\n\nIs there a way we can do this in async/simpler way? Maybe we can add some API call to fetch only changed jobs in the last N time for the client? And then have a separate schedule for updating this data in a single API call? Or at least to iterate over only changed jobs and not all jobs assigned.\nMaybe this change worth having some small spec?","commit_id":"0103788784360d6e4539c562ad4776cf06d0c11e"},{"author":{"_account_id":39044,"name":"Alicja Filipek","display_name":"alaf01","email":"alicja.filipek@cleura.com","username":"alaf01"},"change_message_id":"68eeb25984a7624d0b5e88ad83ad0abe4ebcd35e","unresolved":true,"context_lines":[{"line_number":384,"context_line":""},{"line_number":385,"context_line":"    def process_event(self, job_doc):"},{"line_number":386,"context_line":"        with self.scheduler.lock:"},{"line_number":387,"context_line":"            # Unconditionally: a job with no pending event never enters the"},{"line_number":388,"context_line":"            # loop below and would otherwise never see the update."},{"line_number":389,"context_line":"            schedule_changed \u003d self.refresh_job_doc(job_doc)"},{"line_number":390,"context_line":""},{"line_number":391,"context_line":"            next_event \u003d job_doc[\u0027job_schedule\u0027].get(\u0027event\u0027, \u0027\u0027)"},{"line_number":392,"context_line":"            # Re-arming a running job would churn its state mid-execution;"}],"source_content_type":"text/x-python","patch_set":2,"id":"80c554d2_65ce4165","line":389,"range":{"start_line":387,"start_character":0,"end_line":389,"end_character":60},"in_reply_to":"1817ae76_3dd220a7","updated":"2026-08-21 07:00:58.000000000","message":"refresh_job_doc does not make another api request, it just uses what it already have. Schedulers calls api anyways every 60 sec and get full data, just do not apply the job changes. So we almost do not increase latency here (other than the deep copying we perform).","commit_id":"0103788784360d6e4539c562ad4776cf06d0c11e"},{"author":{"_account_id":39044,"name":"Alicja Filipek","display_name":"alaf01","email":"alicja.filipek@cleura.com","username":"alaf01"},"change_message_id":"a88107523421c40c60a9760db53374275ae39ddd","unresolved":true,"context_lines":[{"line_number":384,"context_line":""},{"line_number":385,"context_line":"    def process_event(self, job_doc):"},{"line_number":386,"context_line":"        with self.scheduler.lock:"},{"line_number":387,"context_line":"            # Unconditionally: a job with no pending event never enters the"},{"line_number":388,"context_line":"            # loop below and would otherwise never see the update."},{"line_number":389,"context_line":"            schedule_changed \u003d self.refresh_job_doc(job_doc)"},{"line_number":390,"context_line":""},{"line_number":391,"context_line":"            next_event \u003d job_doc[\u0027job_schedule\u0027].get(\u0027event\u0027, \u0027\u0027)"},{"line_number":392,"context_line":"            # Re-arming a running job would churn its state mid-execution;"}],"source_content_type":"text/x-python","patch_set":2,"id":"bb7164b1_88a91ca0","line":389,"range":{"start_line":387,"start_character":0,"end_line":389,"end_character":60},"in_reply_to":"3302a939_4fefca2a","updated":"2026-08-24 14:54:57.000000000","message":"The fix is for jobs actions as well, but yes, before this patch we have the same problem with action. Now we use updated document from api.\n\nThe job_doc is stored in memory, but the strange part is that in get_jobs jobs are save to disk and never used in api mode. Mabe it is worth just remove it in the follow up, as it is misleading.","commit_id":"0103788784360d6e4539c562ad4776cf06d0c11e"},{"author":{"_account_id":28619,"name":"Dmitriy Rabotyagov","email":"noonedeadpunk@gmail.com","username":"noonedeadpunk"},"change_message_id":"f3b1c144a40411114d55a060189b5ab8e60d58a2","unresolved":true,"context_lines":[{"line_number":384,"context_line":""},{"line_number":385,"context_line":"    def process_event(self, job_doc):"},{"line_number":386,"context_line":"        with self.scheduler.lock:"},{"line_number":387,"context_line":"            # Unconditionally: a job with no pending event never enters the"},{"line_number":388,"context_line":"            # loop below and would otherwise never see the update."},{"line_number":389,"context_line":"            schedule_changed \u003d self.refresh_job_doc(job_doc)"},{"line_number":390,"context_line":""},{"line_number":391,"context_line":"            next_event \u003d job_doc[\u0027job_schedule\u0027].get(\u0027event\u0027, \u0027\u0027)"},{"line_number":392,"context_line":"            # Re-arming a running job would churn its state mid-execution;"}],"source_content_type":"text/x-python","patch_set":2,"id":"3302a939_4fefca2a","line":389,"range":{"start_line":387,"start_character":0,"end_line":389,"end_character":60},"in_reply_to":"80c554d2_65ce4165","updated":"2026-08-24 08:24:43.000000000","message":"Do we also refresh actions if their definition has changed? As I assume it would be having the same issue there as well?\n\nAs job timer is one small piece of the puzzle here? And the way job_doc is stored locally when it\u0027s fetched from the API is actually the problem?","commit_id":"0103788784360d6e4539c562ad4776cf06d0c11e"},{"author":{"_account_id":28619,"name":"Dmitriy Rabotyagov","email":"noonedeadpunk@gmail.com","username":"noonedeadpunk"},"change_message_id":"3bce040dc2971b5718510315b2052dcbe63f0f9d","unresolved":false,"context_lines":[{"line_number":384,"context_line":""},{"line_number":385,"context_line":"    def process_event(self, job_doc):"},{"line_number":386,"context_line":"        with self.scheduler.lock:"},{"line_number":387,"context_line":"            # Unconditionally: a job with no pending event never enters the"},{"line_number":388,"context_line":"            # loop below and would otherwise never see the update."},{"line_number":389,"context_line":"            schedule_changed \u003d self.refresh_job_doc(job_doc)"},{"line_number":390,"context_line":""},{"line_number":391,"context_line":"            next_event \u003d job_doc[\u0027job_schedule\u0027].get(\u0027event\u0027, \u0027\u0027)"},{"line_number":392,"context_line":"            # Re-arming a running job would churn its state mid-execution;"}],"source_content_type":"text/x-python","patch_set":2,"id":"07e0e6ee_6154374f","line":389,"range":{"start_line":387,"start_character":0,"end_line":389,"end_character":60},"in_reply_to":"bb7164b1_88a91ca0","updated":"2026-08-24 15:05:43.000000000","message":"aha, ok, so I was mislead by this then:)","commit_id":"0103788784360d6e4539c562ad4776cf06d0c11e"}]}
