2011-12-19 00:24:47 utc |
jmettraux |
rufus-scheduler doesn't keep an archive of jobs that were scheduled and that triggered. |
2011-12-19 09:00:08 utc |
lofic |
hello |
2011-12-19 09:01:43 utc |
lofic |
I launch like this : |
2011-12-19 09:01:47 utc |
lofic |
http://pastebin.com/UycaNMM1 |
2011-12-19 09:02:22 utc |
lofic |
the second job takes some time |
2011-12-19 09:02:26 utc |
jmettraux |
lofic: hello, so I guess you want the scheduler to archive dead jobs ? |
2011-12-19 09:02:37 utc |
lofic |
not dead ones |
2011-12-19 09:02:40 utc |
lofic |
running ones |
2011-12-19 09:03:00 utc |
jmettraux |
sorry, it doesn't do that |
2011-12-19 09:03:27 utc |
lofic |
on my example the result of the 2d job is printed long after there is no job anymore in scheduler.all_jobs |
2011-12-19 09:03:30 utc |
lofic |
oh |
2011-12-19 09:03:30 utc |
jmettraux |
they get removed just before they're triggered |
2011-12-19 09:03:46 utc |
lofic |
but there are still running |
2011-12-19 09:03:50 utc |
lofic |
hmmm |
2011-12-19 09:04:04 utc |
lofic |
that's not good news for me |
2011-12-19 09:04:19 utc |
lofic |
I need toquery the state of the jobs |
2011-12-19 09:09:07 utc |
jmettraux |
it should not be too difficult to modify "in" and "at" jobs to remove post-trigger, but it's been like that for 4 years and you're the first one to complain |
2011-12-19 09:11:46 utc |
lofic |
i'm not complaining |
2011-12-19 09:11:51 utc |
lofic |
i'm asking :) |
2011-12-19 09:12:53 utc |
lofic |
usually when you query a scheduler you want to see pending/running/finished jobs |
2011-12-19 09:13:16 utc |
lofic |
strange I'm the first needing that |
2011-12-19 09:14:35 utc |
lofic |
do you know how i could list the active threads ? |
2011-12-19 09:15:08 utc |
jmettraux |
Thread.list |
2011-12-19 09:15:16 utc |
jmettraux |
iirc |
2011-12-19 09:31:01 utc |
lofic |
OK |
2011-12-19 09:31:32 utc |
lofic |
the thread disappears also from the list when the job is triggered |
2011-12-19 09:31:45 utc |
lofic |
how do you launch the job ? |
2011-12-19 09:32:00 utc |
lofic |
is it forked in an other process ? |
2011-12-19 09:34:05 utc |
jmettraux |
by default, the triggered job gets its own thread |
2011-12-19 09:41:01 utc |
lofic |
strange, I launch 2 jobs, I see one thread |
2011-12-19 09:41:12 utc |
lofic |
│ │ └─schedtest.rb ./schedtest.rb |
2011-12-19 09:41:12 utc |
lofic |
│ │ └─{schedtest.rb} |
2011-12-19 09:41:24 utc |
lofic |
├─rsyslogd -c 4 |
2011-12-19 09:41:24 utc |
lofic |
│ ├─{rsyslogd} |
2011-12-19 09:41:24 utc |
lofic |
│ └─{rsyslogd} |
2011-12-19 09:41:57 utc |
lofic |
(I'm sure I have two jobs) |
2011-12-19 09:42:38 utc |
jmettraux |
the jobs get their thread when they're triggered |
2011-12-19 09:45:55 utc |
jmettraux |
you're looking at threads from the point of view of the OS? |
2011-12-19 09:47:58 utc |
lofic |
both :) |
2011-12-19 09:48:35 utc |
lofic |
but i tested with other threads : it seems pstree can't see all the threads of a ruby program |
2011-12-19 09:48:44 utc |
lofic |
so that's not rufus |
2011-12-19 09:50:42 utc |
lofic |
but from the point of view of the program |
2011-12-19 09:51:17 utc |
lofic |
Thread.list only shows some threads when the jobs are not triggered |
2011-12-19 09:51:36 utc |
lofic |
after trigger : nothing in the list anymore |
2011-12-19 09:52:02 utc |
lofic |
so I still don't know how to get my list of running tasks |
2011-12-19 09:52:11 utc |
jmettraux |
there should be the main thread and the thread used by the scheduler |
2011-12-19 09:52:22 utc |
jmettraux |
at least |
2011-12-19 09:54:31 utc |
lofic |
would you mind testing : |
2011-12-19 09:54:33 utc |
lofic |
http://pastebin.com/drN81uJA |
2011-12-19 09:54:34 utc |
lofic |
? |
2011-12-19 09:54:41 utc |
lofic |
you'll see my point |
2011-12-19 09:55:09 utc |
lofic |
(sorry you should get rid of the fib requirement) |
2011-12-19 09:58:38 utc |
lofic |
a better version : |
2011-12-19 09:58:40 utc |
lofic |
http://pastebin.com/A0zWkvu5 |
2011-12-19 10:01:09 utc |
jmettraux |
https://gist.github.com/1496397 |
2011-12-19 10:02:03 utc |
jmettraux |
your version doesn't reach "puts Thread.list" when all the jobs triggered |
2011-12-19 10:03:21 utc |
lofic |
ah yes |
2011-12-19 10:03:22 utc |
jmettraux |
s/when/after/ |
2011-12-19 10:03:24 utc |
lofic |
sorry |
2011-12-19 10:05:00 utc |
lofic |
of course |
2011-12-19 10:05:29 utc |
lofic |
so now I just need a way to match a specific thread id with a job |
2011-12-19 10:07:17 utc |
lofic |
do you have anyidea on that ? |
2011-12-19 10:08:39 utc |
jmettraux |
I'd modify the scheduler to let jobs flag their Threads with their job id as they get triggered |
2011-12-19 10:08:53 utc |
jmettraux |
Thread.current['x'] = 'y' |
2011-12-19 10:09:36 utc |
jmettraux |
Thread.list.select { |t| t['x'] == 'y' } |
2011-12-19 10:09:39 utc |
jmettraux |
or something like that |
2011-12-19 10:17:57 utc |
lofic |
ok thanks |
2011-12-19 10:18:07 utc |
lofic |
I must check |
2011-12-19 10:20:55 utc |
jmettraux |
you're welcome |