There was at least one case where we weren't cleaning up
subsidiary processes (e.g. VMs) when a task's main process exited.
Fix this by consolidating task cleanup (shared mem and subsidiary processes)
in ACTIVE_TASK::cleanup_task().
This gets called when a tasks' main process exits.
"Subsidiary processes" are
1) descendants
2) "other PIDs" as reported by the app, e.g. VMs which are not descendants
We were failing to clean up these processes in some cases.
- Add a function ACTIVE_TASK::kill_exited_app() for killing the
subsidiary processes of a task whose main process has already exited.
At this point we can't enumerate its current descendants;
but we have the list of descendants from the last time
we computed memory usage (within the last 10 sec).
So kill this, and kill the other PIDs
- call this function when appropriate:
- too many temporary exits
- too many premature exits
- main process has exited in response to abort or quit message
(the existing code failed to kill other PIDs)
- rename ACTIVE_TASK::kill_task() to kill_running_task()
to emphasize its intended use.
Also remove code that, in case of secure install on Windows,
didn't try to kill any subsidiary processes at all;
there used to be a permission problem in doing so, now there isn't.
Vboxwrapper detects known buggy versions of Vbox and calls
boinc_temporary_exit().
The "Incompatible version" message appears in the task status
in the BOINC Manager, where some users may never see it.
It needs to appear as a notice, telling the user to upgrade VBox.
To do this, I added an optional argument to boinc_temporary_exit()
saying that the message should be delivered as a notice.
This is conveyed to the client by adding
a line containing "notice" to the temp exit file.
I changed the client and vboxwrapper to use this.
My last commit did this using a new API call.
But this would require rebuilding apps any time you want to change it;
too much work.
So instead make it an attribute of apps,
which you can set via the admin web interface.
Corresponding changes to client.
Currently the duration estimate for a task is a combination of
- a static estimate, based on wu.rsc_fpops_est and the estimated FLOPS
- a dynamic estimate, based on fraction done (FD) and elapsed time
The weighting of the dynamic estimate is FD^2;
the assumption is that fraction done is imprecise and improves
toward the end of a task.
This isn't ideal for apps that can supply accurate FD.
Solution: add a new API function
boinc_fraction_done_exact().
This notifies the client that the FD is accurate,
and that it should use only the dynamic estimate.
(New clients will do this; old clients will use the FD as the currently do).
If a job reports its network usage (via boinc_network_usage()),
keep track of this across episodes of the job, and report it to the server
(some projects may want to give credit for network usage).
Also fixed a bug where, if a job was aborted while not running,
its final CPU and elapsed time weren't copied from ACTIVE_TASK to RESULT,
hence not sent to scheduler
- If you run the client with --run_test_app,
runs "test_app" in the current directory and interacts with it
(and does nothing else).
It can suspend/resume it with arbitrary timing;
this is controlled in run_test_app() (app_start.cpp).
- example app: add --critical_section option.
This lets you test the runtime system for apps that do
most of their work in a critical section (like GPU apps).
- Add some logging messages (conditioned by DEBUG_BOINC_API)
to the runtime system.
- boinc_finish() waits for the timer thread to write final messages;
make sure it doesn't do anything else
(like suspend the worker thread) during this period
- client: if an app's finish file has existed for 10 seconds, kill it;
it must be hung in boinc_finish().
This behavior has been seen with LHC@home and maybe other projects.
(whereas they didn't do this w/ older clients).
On Windows, the client uses TerminateProcess(h, 1) to kill processes;
the 1 is the exit code the process will appear to have.
So instead, add a "will_restart" bool arg to the various kill
functions, and if set use 0 (= STATUS_SUCCESS),
otherwise use EXIT_ABORTED_BY_CLIENT.
Note: in principle this shouldn't make any difference
for quitting tasks,
since handle_exited_app() checks for task state QUIT_PENDING
and ignores the exit code in that case.
The only place I can see where it would make any difference
is when we kill a process because it hasn't been handling
queued shared-memory messages for 180 seconds.
- client: add more info to the message about an exited app
- client: function return values (ERR_*) are different from
process exit codes (EXIT_*).
But in many places we were using return values as exit codes.
Fix these.
Also, break out the different types of limits a job can exceed
(time, disk, memory) into difference exit codes.
svn path=/trunk/boinc/; revision=25601
(time between sending app a quit/abort message
and, if not exited yet, killing it)
- client: if app has reported an "other PID"
(e.g., vboxwrapper reports the VBoxHeadless PID)
then include it (along with descendants) in the
list of processes we kill when killing the job.
svn path=/trunk/boinc/; revision=25470
to a quit request. On older XP machines it might speed up the memory
dump to disk.
- client: Increase the quit request timeout from 10 seconds to 60 seconds for
machines running VMs and slow disk drives. It should give the VM enough
time to gracefully shutdown and not give boinc reason to kill the wrapper.
client/
app.h
samples/vboxwrapper/
vbox.cpp, .h
vboxwrapper.cpp
svn path=/trunk/boinc/; revision=25433
boinc_temporary_exit(),
explaining why the app is exiting.
Convey this to the client, and then to the Manager,
and display it there and in the log.
clientgui/
MainDocument.cpp
lib/
gui_rpc_client_ops.cpp
gui_rpc_client.h
api/
boinc_api.cpp,h
client/
client_types.cpp,h
app.h
app_control.cpp
svn path=/trunk/boinc/; revision=25315
When a large file is copied from a project dir to a slot dir,
it's copied in chunks,
interleaved with other polling activities such as GUI RPCs.
That way the manager doesn't freeze while large copies
(e.g. VM images) are happening
svn path=/trunk/boinc/; revision=25192
connection information to the manager
- MGR: Add a "Show VM Console" button for those tasks which
report a remote desktop port number.
client/
app.cpp, .h
app_control.cpp
clientgui/
Events.h
MainDocument.cpp, .h
ViewWork.cpp, .h
lib/
gui_rpc_client.h
gui_rpc_client_ops.cpp
svn path=/trunk/boinc/; revision=25036
If set, don't run jobs for that app while network is suspended.
- client: parse this flag and maintain in state file;
do a job reschedule when network suspend state changes
- GUI RPC: add RESULT::network_wait flag;
if set, this job is waiting for network access to be allowed
- Manager: display the above in task info
- add support for "web graphics URL" (see above)
- client: parse message containing URL on graphics_reply channel
and store in ACTIVE_TASK::web_graphics_url
- GUI RPC: add RESULT::web_graphics_url
- Manager: if web graphics URL is present, Show Graphics opens a browser
- remove some vestigial code for pre-V6 graphics
svn path=/trunk/boinc/; revision=24899
This caused 128KB + size of stderr loss for each job.
- client: print error message if reading stderr fails
(e.g. because of malloc failure)
svn path=/trunk/boinc/; revision=24336
explicit rather than determined by position in a list.
- client: add a new "read-only" attribute for GUI RPCs.
This is in preparation for handling GUI RPCs in separate threads.
- client: remove code to support pre-V6 graphics.
svn path=/trunk/boinc/; revision=24232
add a mechanism so that apps can report sub-processes
that are not descendants (e.g., virtual machines)
These processes are then counted as part of the app,
not as "non-BOINC CPU time".
This fixes a bug where processing was incorrectly suspended
because CPU usage by VM apps exceeded the "CPU usage limit" pref.
Implementation:
- the PIDs of the processes in question
are passed from app to client via shared-memory,
in the app_status channel.
A new variant of boinc_report_app_status() supports this.
- the VBox wrapper queries the PID of the VM,
and reports it in this way.
- procinfo_app() includes a new argument: a list of PIDs
that are part of the app, although not ancestrally
related to the main process.
- in the client, ACTIVE_TASK now includes a vector "other_pids".
If this is nonempty, it's passed to procinfo_app().
svn path=/trunk/boinc/; revision=24123
If present, "file_prefix/" is prepended to the logical names
of input and output files of jobs using that app version.
I.e. for Vbox wrapper based app versions, file_prefix is "share",
so that I/O files are put in a "share" subdirectory of the slot dir.
- update_versions: add support for
<dont_throttle>
<file_prefix>x</file_prefix>
in version.xml
svn path=/trunk/boinc/; revision=23924
and its main process exits, everything is OK.
That's not necessarily the case - buggy apps may have
subprocesses that the main process fails to kill.
Solution: when we request a task to exit or abort,
make a list of the descendants.
When the main process exits, kill any remaining descendants.
Also: we weren't checking for the ABORT_PENDING case
in the process exit logic.
This may explain the 5/15 second delay in detaching or
resetting a project with running tasks
svn path=/trunk/boinc/; revision=23738
have run before but are not currently running.
Old:
- We maintain the most recent fraction_done in state file.
But for apps that checkpoint seldom or never,
this is not the relevant value,
and frac done may go down when the app runs.
- fraction_done_elapsed_time is not initialized,
and can have garbage values for jobs that haven't run yet.
New:
- Record, in the state file, the values of
fraction_done and fraction_done_elapsed_time
at the most recent checkpoint.
When the client starts up, use these values.
svn path=/trunk/boinc/; revision=23455
use the elapsed time when fraction done was last reported,
not current elapsed time.
Fix problem where est time remaining increases linearly,
then abruptly decreases when new frac done is reported.
From Bruce Allen.
svn path=/trunk/boinc/; revision=23373
Currently we do a reschedule any time a job checkpoints,
in case there's a job that has finished a time slice
but hasn't checkpointed yet.
Instead: flag such jobs, and trigger a reschedule
on checkpoint only for flagged jobs.
- client: fix instability in job scheduling that happens
if a job's estimated completion time in RR sim is close to its deadline.
It can alternate between making and missing deadline,
causing the scheduler to alternate rapidly between jobs.
Solution: if RR sim has marked a job as deadline miss
any time in the last (CPU scheduling period),
treat it as a deadline miss.
svn path=/trunk/boinc/; revision=22928
recent estimated credit (REC) instead of debt.
These changes are enabled by
#define USE_REC
in work_fetch.h.
If this is commented out (the default) the client uses
debt-based scheduling, same as before.
TODO: work-fetch policy changes
- client simulator: various fixes:
- compute idle and wasted fraction based on all processing resources,
not just CPU
- compute job completion times based on FLOPS, not CPU seconds
- compute and use project->no_X_apps
etc.
svn path=/trunk/boinc/; revision=22741
Additions to request message:
<not_started_dur>X</not_started_dur>
<in_progress_dur>X</in_progress_dur>
The estimated remaining duration of unstarted
and in-progress tasks
Additions to reply message, within <project>, optional:
<suspend>0|1</suspend>
suspend or resume project (overrides local state)
<abort_not_started>0|1</abort_not_started>
if set, abort unstarted jobs
svn path=/trunk/boinc/; revision=22698
Insteady of using its own XML input files,
the simulator now takes a client_state.xml file as input.
The simulator generates a synthetic workload based on the
projects, apps, app versions, WUs, and result it finds there.
This means that a user seeing aberrant behavior
can just send their client_state.xml file
and (hopefully) we can use the simulator to repro.
The simulator now can model GPUs.
As of this checkin, the simulator compiles but doesn't work.
There should be no change in the actual client.
svn path=/trunk/boinc/; revision=22409
Report it to the manager
(it was already in CC_STATUS, but not populated)
- manager: fix system tray icon popup text
svn path=/trunk/boinc/; revision=21481