expr() Function prints a lot of warning-exceptions to logfile

54 views
Skip to first unread message

Dominik Bahl

unread,
Oct 17, 2019, 7:42:25 AM10/17/19
to schedulix
Dear schedulix Team,

i have the following exception:
WARNING [0,283412(Worker1)]     17 Oct 2019 11:31:01 GMT Exception (Error evaluating expression. Invalid number format of ) occurred while calculating 'job.sysdate - job.expruntime * 1.5'

I get this, when i execute the following command:
list job with not (EXIT STATE in (finished, CANCELED_BY_USER)) and not (JOB_STATUS in (CANCELLED)) and job.starttime < expr('job.sysdate - job.expruntime * 1.5') and name like 'SYSTEM\.CDCCONFIGURATION\..*';

My aim is to get all Jobs, which are running longer than expected.
And i also want a clean logfile without the warnings. They take 99 percent of the logfile.

The expr() function is explained in the schedulix Command Languague Reference at page 222.
http://www.schedulix.org/de/Downloads/syntax_os_en-2.9.pdf

I did exactly the same as described in the documentation but get a lot of warnings with the Exception from above.

Is this an error in the application or do I use the function in a wrong way?

Kind regards
Dominik

Ronald Jeninga

unread,
Oct 18, 2019, 7:15:29 AM10/18/19
to schedulix
Hi Dominik,

the warnings aren't really important, and I understand you don't like it if your log file is polluted with those messages.
It'll require a patch to get rid of them.

You are using the function the right way, from my point of view.
I'm afraid there are a few bugs in the expression parser :-(

I'll try my best to get a patch ready towards the end of next week.

Best regards,

Ronald

John Tsui

unread,
Oct 21, 2019, 4:00:59 AM10/21/19
to schedulix
Dear Ronald,

Upon the same request, I had drafted below script for monitoring:
NOW=`date +%s`
echo "LIST JOB WITH JOB_STATE IN (STARTED,RUNNABLE,RUNNING) AND JOB.EXPRUNTIME > EXPR('0') AND JOB.STARTTIME < EXPR('$NOW - JOB.EXPRUNTIME');" | sdmsh | awk '/\-\-/,/^$/' | sed '1'd | sed '$'d | awk '{print $1,$3}' | while read ID HIERARCHY_PATH
do
  echo Execution time of `echo $HIERARCHY_PATH | rev | cut -f1 -d'.' | rev` exceed `expr \`echo "SHOW JOB $ID;" | sdmsh | grep " SE_EXPECTED_RUNTIME : " | awk '{print $3}'\` / 60` minutes.
done

But this script had to be execute periodically every 5 minutes, is it possible to make use of the value of "JOB.EXPRUNTIME" of individual job to trigger alert message instead of checking all jobs periodically ?

Thanks in advance for your help in the pass.

Regards,
John Tsui
21.Oct.2019

Ronald Jeninga

unread,
Oct 21, 2019, 4:19:13 AM10/21/19
to schedulix
Hi John,

yes, you can make use of the UNTIL_* trigger types.
In fact I am doing this in my current project.

And as a matter of fact I run into the same kind of problem as Dominik.
This is why this issue is high on my own wish list too.

Both the expressions in Triggers as well as the comparisons in the LIST JOB statement are handled by the same piece of code.
Hence it'll be a single repair and two totally different test cases (which is good).

My time planning still allows to get this issue resolved towards the end of the week.

Best regards,

Ronald

John Tsui

unread,
Oct 21, 2019, 10:22:35 PM10/21/19
to schedulix
Dear Ronald,

Many thanks.
Will wait for the good news.

Best Regards.
John Tsui
22.Oct.2019

Dominik Bahl

unread,
Oct 22, 2019, 1:29:12 AM10/22/19
to schedulix
Hi Ronald,

thanks for your answer.
I will wait for the fix / good news too :)

Best Regards
Dominik

Dominik Bahl

unread,
Oct 22, 2019, 8:26:09 AM10/22/19
to schedulix
Hi Ronald,

one questions to the job.starttime < expr('job.sysdate - job.expruntime * 1.5') expression.
What value does the variable job.expruntime relate to?
I configured in the Job Definition a Expected Finaltime [Sec] and Expected Runtime [Sec] to 120.

As you can see in the screenshot i've got 4 Jobserver, which will clean their own disk and one jobserver will clean a mounted disk.
In our example JS1 cleaned up the mounted disk, but for the next run JSX will clean up the mounted disk and will run longer.

But why will the job also be listed when i set the Expected Runtime to 120 Seconds and the Job runs only 75 Seconds?

list job 1866254 with job.starttime < expr('job.sysdate - job.expruntime * 1.5');

Will return the job as well. But why?
120 * 1,5 > 75 => So normally it should not return the job?

Or do i understand it wrong?

Kind regards
Dominik
job_expruntime.png

Ronald Jeninga

unread,
Oct 22, 2019, 10:38:48 AM10/22/19
to schedulix
Hi Dominik,

we've found similar problems as Dieter and I were thinking about your original post.
But I'll fix that too, no worries.

job.expruntime should return the Expected Runtime value.
It is possible though, that it has been evaluated as a String, and "75" > "180".
String compares on numerical values sometime yield unwanted effects.

I'll have to do some work here.
Implementing a typed language is far easier than an untyped language.

I'll notify you as soon as I have it fixed.

Best regards,

Ronald

Ronald Jeninga

unread,
Oct 25, 2019, 10:35:26 AM10/25/19
to schedulix
Hi Dominik,

I've checked in a first improvement into GitHub.
Your list command should now work without warnings (it did for me).

I'll build the rpms at latest next week.

@John: I hope the trigger conditions benefit from my change as well.
But I didn't have time to test that yet. Sorry.
On my wish list there's also the fast evaluation of conditions (like "TRUE OR something" doesn't require the "something" to be evaluated).
Unfortunately that's a bigger issue :-(

Best regards,

Ronald

Dominik Bahl

unread,
Jan 29, 2020, 8:25:29 AM1/29/20
to schedulix
Hi Ronald,

sorry for the late answer.
Have you built the rpms yet?
If yes, how can I update my current System?

Thanks,
Dominik

Ronald Jeninga

unread,
Jan 29, 2020, 8:54:28 AM1/29/20
to schedulix
Hi Dominik,

if you've installed the system using the rpms, it should be simply a "yum update" or so.
If your system isn't directly connected to the Internet, you'll have to download the rpm file manually and then use that file to do the update.

That should be something like

yum update schedulix-base-2.9-15.el7.x86_64.rpm

It is possible that yum doesn't like to update the base rpm only, in which case you'll have to fetch all the schedulix rpms you've installed.


If you've built the system yourself, you'll have to repeat that after doing a "git pull origin" from your sandbox.

And yes, I've built the rpms. The newest are from December last year.

Best regards,

Ronald

Dominik Bahl

unread,
Feb 3, 2020, 1:38:29 AM2/3/20
to schedulix
Hi Ronald,

thank you for your response.

It worked for me and I don't get those ugly messages any more.

Great work.

Best regards,

Dominik
Reply all
Reply to author
Forward
0 new messages