Commit Graph

29 Commits

Author SHA1 Message Date
David Anderson 80562d230d code cleanup
In .cpp files, put "using std::" at the top and don't use std:: after that
2016-12-16 12:12:00 -08:00
Rom Walton 2cc9a0b6c4 client: Cleanup low hanging fruit with regards to cleaning up sprintf.
Use snprintf instead.
2016-02-18 00:59:13 -05:00
Rom Walton 56da6b11fb client: Cleanup low hanging fruit with regards to cleaning up strcpy and strcat use.
Use safe_strcpy and safe_strcat when dealing with non-pointer data types.
2016-02-15 21:53:07 -05:00
David Anderson 58f7d0cd6c client: clean out project dir on project reset
- always delete the files that BOINC knows about
- if not anonymous platform, delete all files
- except never delete app_config.xml
2015-08-31 11:49:56 -07:00
David Anderson 753ae6e768 client: fix bug that caused delay in job cleanup
If a job has an output file with <copy_file> and <optional>,
and it doesn't create the file,
then the call to boinc_rename() (to move it to the project dir) fails,
and we back off and retry.

Solution: in boinc_rename(), if the rename fails,
check if the file exists, and if it doesn't then don't retry.

Also:
- when writing client messages, use the actual current time
  (dtime()) rather than client_state.now.
- write log msgs when output file renames fail
2015-06-17 14:14:54 -07:00
David Anderson d49437b780 client: fix error in checking unlink() return value 2015-06-12 09:59:56 -07:00
David Anderson fa3f6be512 client: fix bug when delete > 4GB file
The function to delete a slot dir file (delete_project_owned_file())
called boinc_file_or_symlink_exists(),
and returning success (with no message) if this return false.

boinc_file_or_symlink_exists() incorrectly returned false for > 4GB file on Win,
because it used stat(), which handles only 32 bit file size.

Fix: remove the call to boinc_file_or_symlink_exists();
instead, always call DeleteFile(),
and check for the ERROR_FILE_NOT_FOUND status.

I'll fix the stat() problem later.
2015-05-08 14:23:03 -07:00
David Anderson 9ea0bb3585 client: finish last commit 2015-05-04 14:55:18 -07:00
David Anderson 44c82bea9e client: detect errors in directory enumeration
Previously, the dir_scan() function didn't distinguish between
- reaching the end of the directory
- errors
It just returned nonzero in either case.
This means that the function that cleans out a slot dir
(client_clean_out_dir())
could potentially return success even though the directory is nonempty.
This could potentially cause the recently-reported problem
where a slot dir contains a VM image from a previous job.
2015-05-04 14:48:34 -07:00
David Anderson 02c848df4b client: add log msgs for failed file deletion 2015-05-04 01:04:40 -07:00
David Anderson 4c9d1d6659 client: code cleanup and possible debugging in work fetch
- Remove code that tries to keep track of available GPU RAM
  and defer jobs that don't fit.
  This never worked, it relied on project estimates of RAM usage,
  and it's been replaced by having the app do temporary exit
  if alloc fails.
- Move logic for checking for deferred jobs from CPU
  to work fetch.
- Rename rsc_defer_sched to has_deferred_job,
  and move it from PROJECT to RSC_PROJECT_WORK_FETCH
- tweak work_fetch_debug output
2014-10-10 14:35:00 -07:00
Rom Walton 917bf6762c client: Remove the strerror() call from switcher_exec with regards to the task_debug output. For the things switcher does the exit code is not an errno value. 2014-07-31 20:46:44 -04:00
Rom Walton 8384336a74 client: if execv ever fails when attempting to launch switcher, exit as quickly as possible in the forked process.
Returning from the switcher_exec() may leave 2 boinc processes running until one crashes.
2014-07-28 13:28:51 -04:00
Charlie Fenton 5cec137320 client: Fix use of pipes to redirect sdtout/stderr output from switcher and tweak reporting failures as task_debug output with msg_printf(). 2014-07-28 03:17:24 -07:00
Rom Walton ea5dd29f97 client: Append the stdout and stderr buffer in switcher_exec in case the output is more than 1k. 2014-07-27 17:49:01 -04:00
Rom Walton debac23fa3 client: Use pipes to redirect sdtout/stderr output from switcher, report any failures as task_debug output with msg_printf(). 2014-07-27 16:30:02 -04:00
Rom Walton 3689d15294 client: Add missing stub functions for Windows related to removing the SANDBOX ifdef. 2014-07-27 14:19:17 -04:00
Charlie Fenton fb66dd82ae client: try to get a return code from switcher (i.e., from the command that switcher executed.) 2014-07-24 02:39:17 -07:00
David Anderson 33bf4f7851 - client: check error returns from kill() and kill_via_switcher(), show messages 2013-04-10 15:56:40 -07:00
David Anderson aa289f0916 - A bunch of tweaks from Steffen Moller, e.g. using MAXPATHLEN
svn path=/trunk/boinc/; revision=26133
2012-09-21 03:52:24 +00:00
David Anderson f8c1665722 - client: keep track of the fraction of time that
1) a network connection is available and
    2) network communication is allowed and
    3) CPU computation is allowed
- If an app version is marked as needs_network,
    use the above fraction in estimating its rate of progress
- replace "core client" with "client" in comments.
- scheduler: message tweaks


svn path=/trunk/boinc/; revision=25803
2012-06-26 20:30:56 +00:00
David Anderson 32a08d27d9 - C++ code: use MAXPATHLEN for char arrays that hold paths
svn path=/trunk/boinc/; revision=25659
2012-05-09 16:11:50 +00:00
David Anderson a21abed078 - client: fix typo that caused a lot of spurious
"project has XXXXXX deadline misses" messages
- fix compile warnings


svn path=/trunk/boinc/; revision=23816
2011-07-07 23:58:23 +00:00
David Anderson d59af26596 - client: add ".xml" to notice file names
svn path=/trunk/boinc/; revision=21857
2010-07-01 02:01:05 +00:00
Rom Walton 9cb3e6ffc7 - client & lib: bring header inclusion up-to-date for the CC to begin
hunting down a memory leak.
        
    client/
        <Various Files>
    lib/
        <Various Files>

svn path=/trunk/boinc/; revision=21457
2010-05-11 19:10:29 +00:00
David Anderson 10f9e11ee6 - lib: created a new file for declaring "replacements"
for functions like strlcpy() etc.
    config.h is included here rather than in str_util.h


svn path=/trunk/boinc/; revision=18437
2009-06-16 20:54:44 +00:00
David Anderson 575565dc22 - client: fixed nasty bug that caused GPU jobs to crash on startup
when they're preempting another GPU job.
        The problem was as follows:
        - job A is chosen to preempt job B
        - we tell job B to quit, and initialize job A but don't start it;
            however, we set if scheduler state to SCHEDULED
            (rather than UNINITIALIZED)
        - job B exits, and we start job A.
            Since its state is not UNITIALIZED, we don't set up its slot dir.
        - job A runs in an empty slot dir, doesn't find its files, and bombs out.
    - client: add <slot_debug> option (prints messages about
        allocation of slots, creating/removing files in slot dirs).

svn path=/trunk/boinc/; revision=18217
2009-05-28 19:26:27 +00:00
Charlie Fenton f9cf9b656d client sandbox: add details in switcher_exec "execv failed" message
svn path=/trunk/boinc/; revision=16994
2009-01-23 01:18:48 +00:00
David Anderson 98cfb8d3b0 - rename .C files to .cpp so that Doxygen will work
svn path=/trunk/boinc/; revision=16069
2008-09-26 18:20:24 +00:00