Mesos/Chronos How are the tasks getting updated to FINISHED task status? - mesos

I am new to Mesos and trying to understand the flow when the task is successfully finished and how it is updated to Mesos with Chronos.
(in version 2.4.0) When I have a job where the task finished running asynchronously and finished successfully, then my application that will send the outcome to "/scheduler/task/{id}" (in Chronos TaskManagementResource.scala), then it increments the job success counter, and update last successful run time for the job. Then it calls jobsObserver.apply(JobFinished(job, taskStatus, attempt)) which I am bit confused. What does jobsObserver do?
https://github.com/mesos/chronos/blob/c1348ddfd80eb8f888418805005066c230fc6ad2/src/main/scala/org/apache/mesos/chronos/scheduler/jobs/JobScheduler.scala#L216
https://github.com/apache/mesos/blob/c28fd3a93e0d9d9a868aec2380abd1dd338304ef/src/java/src/org/apache/mesos/Scheduler.java#L131

Related

Deployed application on Heroku executes automatically

I am using Advanced Scheduler to schedule a cron job daily once at 12 PM. But the code executes automatically even though I have disabled the trigger and disconnected my GitHub repository. So far the code has executed three times in an interval of 2 hours.
I don't understand why it is executing automatically?
Any idea?

What's the difference between Laravels Queue\ShouldBeUnique and Queue\Middleware\WithoutOverlapping?

I have a job that is somehow getting kicked off multiple times. I want the job to kick off once and only once. If any other attempts to run the job while it's already on the queue, I want those runs to ABORT.
I've read the Laravel 8 documentation and can't figure out if I should use:
Queue\ShouldBeUnique (documented here: https://laravel.com/docs/8.x/queues#unique-jobs)
OR
Queue\Middleware\WithoutOverlapping
mentioned here: https://laravel.com/docs/8.x/queues#preventing-job-overlaps
I believe the first one aborts subsequent attempts to run the job whereas the second keeps it queued, just makes sure it doesn't run until the first job is finished. Can anyone confirm?
Confirmed locally by attempting to run multiple instances of the same job in a console window.
Implementing the Queue\ShouldBeUnique interface in the class of my job means that subsequent attempts are ABORTED.
Whereas adding ->withoutOverlapping() to the end of my job reference in the app\console\kernel.php file simply prevents it from running simultaneously. It does NOT abort the job if one is already running.

Spring Batch - retrieve exceptions with async job

I'm configuring a (long running) job in Spring Batch with an async JobLauncher, and I have two REST endpoint:
/start --> will start the job asynchronously and return the job_execution_id to the client
/status/{job_execution_id} --> will return the status of the job execution based on data stored in JobExecutionContext
In the /status endpoint, I would like to inform the client about any exceptions occurred during the process.
However, I'm not able to retrieve them in the way I was doing with the sync version of the same job:
jobExecution.getAllFailureExceptions() --> empty list
stepExecution.getFailureExceptions() --> empty list
Is there a way to tell Spring Batch to store the exception stacktrace (or at least the exception message), so I can retrieve it later?
Thanks
Giulio
Failure exceptions are added after the job execution is finished (more precisely right before the job is about to finish). So they are not available while the job is running. That's why you can't get them if you call the /status endpoint while the job is running asynchronously in the background.
The same applies for step failure exceptions, but those should be available as soon as the step is finished (while eventual subsequent steps are still running and the surrounding job as well).

Pausing Teamcity builds that are running

I would like to have Teamcity build configuration that currently has 3 build steps:
Build an artifact to perform tests on & install on remote server
Kick off long running test job on remote server
Pause build awaiting external event (i.e. remote job finishing)
Retrieve results and record the report
I have had a look through the documentation and I can see how I can pause (step 3) the entire build configuration (which stops any additional builds running) ... but not just a single running build.
The Step 2 script that is running the external job has the various parameters passed to it, so that it can issue a REST call back to the teamcity server to resume the build job.
Basically I don't want to tie up a build agent waiting the entire hour the test takes to run.
I have googled and everything I can find points me at pausing the build configuration.
I am currently having to look at splitting the build configuration into two. The first will kick of the test job and finish. Then when the external test job finishes it will call teamcity to start a second job to retrieve and store the reports. But that feels disconnected to me in that I will not be able to show a single job with build/test/report.
At the moment (TeamCity v 2018.1) there is no direct way to pause the build, release the build agent, and later resume the execution.
What you described is the recommended workaround.
Also, please watch/vote for related issue: https://youtrack.jetbrains.com/issue/TW-30777

Workflow error - Record required by this workflow job could not be found

I have a basic workflow designed that on completion of a Task - related to an opportunity - the Opportunity is updated.
I get following error
A record required by this workflow job could not be found.
I am not sure where or what to do next ?
Most of the time you receive this error one of the records which are used in the workflow is deleted. Therefore the workflow cannot continue to execute.
This could happen for example
when using a wait condition (wait until task is completed)
when the opportunity is deleted and the workflow tries to update it after completion of the task

Resources