chronos icon indicating copy to clipboard operation
chronos copied to clipboard

"Ghost" job still being scheduled via Chronos, but doesn't show up in /jobs

Open solarkennedy opened this issue 11 years ago • 6 comments

I had a job in chronos that I had deleted via the API, and it no longer shows up in the jobs endpoint.

However, the job is still being scheduled. I can confirm there is a large number of failed tasks in the zk state (http://pastebin.com/ZB3UM5RE), as well as the job itself (http://pastebin.com/spF4HPVP).

So it is "there". The job is trying to be scheduled: http://pastebin.com/f3xyUmHT

I could pastebin the output of the jobs api, but it is just [].

Any idea why the job and tasks are launched internally but the api would not show it in the list? (or webui/csv/stats endpoints)

The job is purposely failing, so maybe it has failed + retries so much that the internal queue is overwhelmed and will never finish, even though the job is destroyed? (but then why would the job still be defined in the zk state?)

I don't have any logs for the original job deletion. Maybe something happened in the job deletion only completed half-way and didn't delete the persistent state part? https://github.com/mesos/chronos/blob/f2736f5dfc3ca2a72e134de625e09c6d0ab2ddfa/src/main/scala/org/apache/mesos/chronos/scheduler/jobs/JobScheduler.scala#L215 (just guessing here)

cc @mrtyler

solarkennedy avatar Sep 12 '15 00:09 solarkennedy

Hi @solarkennedy, thanks for reporting this.

Following up on your hypothesis of the partial job deletion. Does the job show up (or not) after you restart chronos?

kolloch avatar Sep 16 '15 09:09 kolloch

I had been hesitant to restart chronos in case there was evidence you needed for debug. We run in a set of 3. I'll try restarting the current leader today and allow another one to take over and I'll report what happens.

solarkennedy avatar Sep 16 '15 14:09 solarkennedy

Hi @solarkennedy, any news on your issue?

mwasn avatar Sep 22 '15 08:09 mwasn

Yes, thank you for the reminder.

I've stopped chronos on the current leader (1). This caused a new leader to be elected (2). The new leader started (and still is) purging these states with messages like these:

Sep 22 09:45:31 mesos1-uswest1cdevc chronos[32210]: [2015-09-22 09:45:31,924] INFO Filtering out old task 'ct:1442342115961:1:example_service mesosstage_badbatch git0b406351 configa42c4a08:' overdue by '-597955822' ms and removing from store. (org.apache.mesos.chronos.scheduler.jobs.TaskUtils$:96)
Sep 22 09:45:31 mesos1-uswest1cdevc chronos[32210]: [2015-09-22 09:45:31,924] INFO Purging entry 'T_ct:1442547604000:0:example_service mesosstage_badbatch git0b406351 configa42c4a08:' via: org.apache.mesos.state.ZooKeeperState (org.apache.mesos.chronos.scheduler.state.MesosStatePersistenceStore:168)

However, it somehow missed the leader election memo, and now another chronos instance (3) has taken over. Even though (2) is still purging these entries (it probably still thinks it is the leader?)

Update: Now the purging has finished, and it looks like I do have two leaders now :(

solarkennedy avatar Sep 22 '15 16:09 solarkennedy

I've restarted chronos on the second leader and it demoted it self.

I guess there is no mechanism for leaders to "double check" that they are still supposed to be leading?

This may be pretty difficult to reproduce, but this really did happen. I'm ok with closing this for now and re-opening if it happens again if you want. The repro case may be as "simple" as 3 chronos servers and a job that exits 1 and runs every 60 seconds.

solarkennedy avatar Sep 29 '15 17:09 solarkennedy

I'm going to close this for now and open a new one if I can reproduce again.

solarkennedy avatar Dec 11 '15 19:12 solarkennedy