I have a business critical application which needs to run 24*7. Right now its scheduled using Windows Task Scheduler. The problem with current implementation is whenever the application stops it has to wait for 1 minute to run again.(Since one minute is the minimum time to repeat task in Windows Task Scheduler) So I am building my own task scheduler which will start the process(application) within 5 seconds of terminating the process. How should my task scheduler know if the process has terminated. Do I need to keep polling the process every second to check whether its running or not?
You should write your application as a Windows Service, not a standard application.
Among their other advantages, Windows Services give you the ability to define what happens in the event of a failure (e.g. restart application).
They are also very easy to create in C#.
Related
I would like to run multiple scheduled Task Flows against the same data source but only run one at a time.
Example:
Schedule "Nightly" runs once a day (expected runtime 30 minutes),
Schedule "Hourly" runs once an hour (expected runtime 10 minutes),
Schedule "Minute" runs once a minute (expected runtime 5 seconds).
I would like:
#1 "Nightly" test status of "Hourly" and "Minute":
If they are not running, start "Nightly",
If either are running, loop around until both have stopped.
#2 "Hourly" test status of "Nightly" and "Minute":
If they are not running, start "Hourly",
If "Nightly" is running, exit,
If "Minute" is running, loop around until both have stopped.
#3 "Minute" test status of "Nightly" and "Hourly":
If they are not running, start "Minute",
If either are running, exit.
So far, I am using handshakes with several JSON files in the cloud.
Meaning, if "Minute" is running, the file minute.json contains information telling a caller "Minute" is running.
When "Minute" ends, it updates its file, minute.json, to reflect the operation has stopped.
As you can imagine, this is very slow.
Also, Informatica will always create a JSON file when JSON is the target. The issue here is, if there is any issue, Informatica will create a 0 file size JSON file that will fail any operation calling it.
There has got to be a better way.
You could use the Informatica Platform REST API v2 to monitor and control the execution of your jobs programmatically from an external site.
It's a bit involved to set everything up and write the logic or configure driving tools but this setup should give you full control, including error handling, logging, alerting, etc.
login (there are a number of options like SAML, and Salesforce credentials)
Then you could check the status and outcome of your jobs in the activity log or the activity monitor via API
use job and/or schedule via API to run your jobs.
I work in the automotive embedded C programming domain and someone asked me what's the OS tasks system of my project (AUTOSAR). I am working in static analysis using Astree tool chain. I didn't have to create OS configuration for my project as it's generated by the other teams. So what is tasks in our embedded system? And how it work with thousands of C and H files in large Software? Is it referring to how we build the project?
For example:
void task_OS_10ms_Task(void) {
Rte_task_Cont_BswStart_10ms();
FiM_MainFunction();
DDRC_Proc_ArDebMainFunction_10ms();
DFES_Proc_Data();
ComCIL_Adapt_Proc_10ms();
ComCIL_Co_Proc();
}
void task_OS_1ms_Task(void) {
Rte_task_Cont_BswStart_1ms();
Rte_task_Cont_BswEnd_1ms();
} // End of OS_1ms_Task
With above example, its mean 6 functions will be executed in total 10 ms or each one in 10 ms (total 60 ms)?
A Task is the smallest schedulable unit managed by the OS. It's equivalent to "Thread".
A Task is the object which executes (user) code and which is managed by the
OS. E.g. the OS switches between different Tasks (“schedules”). There are 2
types of Tasks; for more details see [15].
Basic Task: A Task which can not block by itself. This means that it can not
wait for (OS) event(s).
Extended Task: A Task which can block by itself and wait for (OS) event(s).
(Source: AUTOSAR_SWS_OS.pdf ver 4.2)
What you have inside a task are runnable entities or Main Processing Functions (Scheduled Functions) of BSW modules.
The 10ms that you have in the name of the task does not mean that this task will be executed every 10ms. The Period 10ms is part of Schedule Table which has to be defined in OS module. Keep in mind that AUTOSAR OS does not offer deadline monitoring for timing protection. This missing feature can be handled by WD stack.
In your example, All the functions has to be executed every 10ms. But sometimes we can map a runnanble (e.g 100ms) to a task 10ms, in this case the RTE will generate events/counters to be able to execute your runnable every 100ms.
The example you have here is simply talks about task enclosing some functions called cyclically. your task_os_10ms_task() is scheduled every 10ms by OS scheduler, and every function inside it also. Total execution time for the entire task would depend on what is your CPU frequency. It could be few ms or usecs but definitely not 60ms. Similarly, Your task_os_1ms_task() is going to be scheduled by os scheduler every 1ms. And, so are your RTE start and end function in it. Inside the task body it is simply a round robin execution. If your task is preemptive and a higher priority task is pending at then, os scheduler will. preempt your task and start the higher priority task. If not then, entire task is completed and control goes back to OS scheduler.
Which is the best option for an asp .net core app that does some recurring tasks on my main database (This database holds the data for a webapi that lives in the same machine).
Does a never ending process (this process can be relaunched if anthing bad happens) be better than an app that is ran every x seconds by Cron?
If your answer is "cron is better" won't be the "never ending process" option more performant because it doesn't need to run through all the initial setup, etc.?
Can someone of you help me, how to make the following service selected in the image get into wait mode after starting the server.
Please let me know if developer trace is required to be posted for resolving this issue.
that particular process is a BATCH process, a process that runs scheduled background tasks (maintained by transaction SM36/SM37). If the process is busy right after starting the server, that means there were scheduled tasks with status released waiting for execution, and as soon as the server was up, it started those tasks.
If you want to make sure the system doesn't immediately start released background tasks, you'll have to set the status back to scheduled (which, thanks to a bit of weird translation, means they won't be executed because they are not released).
if you want to start the server without having a chance to first change the job status in SM37, you would either have to reset the status on database level (likely not officially supported by SAP) or first start the server without any BATCH processes (which would give you a number of great big warning messages upon login) and change the job status before then restarting the server with the BATCH processes. You can set the number of processes for each type in the profile of your instance (parameter rdisp/wp_no_btc).
I have a job which i want to work as scheduler.
I found that there is an option for scheduling a job in pentaho 5.0 from the start step input
which has scheduling options for interval/day etc..
But my question is will the scheduling happen even if i close the pentaho i.e spoon window?
Or should it be up always?
You have to look into how to create cron-job or screen in linux for the same, means you have to start your job in back-ground so it never die.
So in windows such facility is not available so in windows your tool should be up all the time for executing batch process.
Scheduling takes place at the Data Integration server level. If you don't have a DI server running you need to schedule it using the OS scheduling facility (task manager on Windows or cron) and call the job or transformation by using kitchen or pan, resp.