It's hard to debug it to find out myself.
What happens if eta is past when you call apply_async() ?
silently drops it? executes it because it should have been in the past?
I just tested this on our setup, eta in the past definitely works.
Celery does not drop the task - It gets executed more or less immediately. Hope this helps!
From the documentation:
The ETA (estimated time of arrival) lets you set a specific date and time that is the earliest time at which your task will be executed. countdown is a shortcut to set eta by seconds into the future. The task is guaranteed to be executed at some time after the specified date and time, but not necessarily at that exact time.
Related
there is a "natural" ( I mean thought parameter) way to limit the number of triggering a dag (let say every 24 hours).
I don't want to schedule it, but some user can trigger the same dag multiple time, and for resources and others reason, I want it only once .
As I see "depends_on_past" depend only against the previous run, but it could be many time a day.
Thx
Not directly, but you could likely implement task_instance_mutation_hook in the first task of the DAG, it could then immediately fail the task if you check if it's been run several times the same day.
https://airflow.apache.org/docs/apache-airflow/stable/concepts/cluster-policies.html#task-instance-mutation
I know the tasks won't be schedulable but what if I have to choose at a certain time between a task which has already missed its deadline and another task with a deadline still ahead. What does the algorithm state in this case?
Thank you
From my search, it haven't seen anyone say anything specific about what happens when a task's deadline is older than the current time. The specific action would be up to the developer, because I don't think that task would be a valid task in a valid schedule. When a task misses it's deadline and is yet to be executed, it should be dropped, when using any valid schedule.
Given that scheduling usually happens periodically, by the time the new schedule is set up, it would have a new deadline or it would have been dropped I believe if the task is aperiodic and has not been submitted again.
This document about the linux kernel's specific algorithm shows an example and an explanation of one obvious solution by a developer, when the task deadline < current time.
The one that has missed continues until it finishes its execution. This can lead to the domino effect in EDF.
Check out "Transient Over Load Condition & Domino Effect in Earliest deadline first" here
Just wanted what is the possible reasons why my persistentEntityRegistry.eventStream takes an approximately ~8-12 seconds to be emitted.
I have just figured out that its the cassandra that's taking a delay. What I've done is to set cassandra-query-journal.eventual-consistency-delay to 200ms.
My references are the following:
https://groups.google.com/forum/#!topic/lagom-framework/cLXf6r5Ouw4
https://groups.google.com/forum/#!topic/akka-user/TH8hL-A8I4k/discussion
I am currently working on Quartz Scheduler (version 1.4.2). I am trying to code scheduler in such a way so that I can set Repeat Interval duration after starting the scheduler. I tried many ways to do it but its not working. Can anyone tell me how can we adjust the Repeat Interval Duration during runtime.
Thanks in advance.
You'll need to unschedule the current job first, then reschedule it with the new interval value. Put a form in your GUI to use to set the new interval value at runtime, you can process the rescheduling when the value gets updated.
See this answer for an example using CronTrigger. The details will vary slightly for an Interval job, but it should be enough to get you going.
Can any body explain me what is the difference among sleep() , usleep() & [NSThread sleepForTimeInterval:] ?
What is the best condition to use these methods ?
sleep(3) is a posix standard library method that attempts to suspend the calling thread for the amount of time specified in seconds. usleep(3) does the same, except it takes a time in microseconds instead. Both are actually implemented with the nanosleep(2) system call.
The last method does the same thing except that it is part of the Foundation framework rather than being a C library call. It takes an NSTimeInterval that represents the amount of time to be slept as a double indicating seconds and fractions of a second.
For all intents and purposes, they all do functionally the same thing, i.e., attempt to suspend the calling thread for some specified amount of time.
What is the best condition to use
these methods ?
Never
Or, really, pretty much almost assuredly never ever outside of the most unique of circumstances.
What are you trying to do?
On most OSs, sleep(0) and its variants can be used to improve efficiency in a polling situation to give other threads a chance to work until the thread scheduler decides to wake up the polling thread. It beats a full-on while loop. I haven't found much use for a non-zero timeout though, and apple in particular has done a pretty good job of building an event driven architecture that should eliminate the need for polling in most situations anyway.
-Example usage of sleep is in the following state:
In network simulation scenario, we usually have events that are executed event by event,using a scheduler. The scheduler executes events in orderly fashion.
When an event is finished executing, and the scheduler moves to the next event, the scheduler compares the next event execution time with the machine clock. If the next event is scheduled for a future time, the simulator sleeps until that realtime is reached and then executes the next event.
-From linux Man pages:
The usleep() function suspends execution of the calling thread for (at least) usec microseconds. The sleep may be lengthened slightly by any system activity or by the time spent processing the call or by the granularity of system timers.
while sleep is delaying the execution of a task(could be a thread or anything) for sometime .Refer to 1 and 2 for more details about the functions.