Review: job scheduling has 2 phases:
1) Make a list of jobs to run. Add enough jobs to use all resources.
2) Actually run the jobs and preempt existing jobs.
The problem: checking for RAM usage limits
(i.e. making sure the sum of working sets is < RAM usage prefs)
is done in 2) but not 1).
So on a 1 CPU machine we might make a run list consisting of a single job,
which turns out not to fit in available RAM,
and we end up running nothing.
Solution: when we add a job to the run list that previously
exceeded RAM limits, don't count its resource usage.
That way we'll add more jobs to the run list,
and we'll have something to run in the end.
Turns out tempnam() can't be used;
it gives priority to the env var TMPDIR in deciding where to
put the temp file (overriding the prefix arg)
and this could be on a different volume.
Instead, use msktemp (Unix) and GetTempFileName (Win).
And factor this out into a util function, boinc_temp_file().
Ideally we would upgrade all platforms en mass, but forcing ARM, MIPS, and x86 to API 21 might introduce compatibility problems with our existing install base.
At some point we decided that OS reporting of mem usage for VM apps
was wrong, and we use wu.rsc_mem_usage instead.
Fix: use this only for running VM apps; for non-running, use zero.
Also, in mem usage print (mem_usage_debug) show whether the job is running.
Ironically, should the user specify invalid XML tag in cc_config.xml, BOINC will write log message containing that tag unescaped and unclosed. Needless to say, it breaks XML parsing instantly. This patch auto-closes this tag in the log message.
Try all download servers when multiple URLs are supplied by the project. This is needed because the first download server may be unreachable or out of sync which produces a permanent error. Uploads are handled differently and always use the transient_failure() function.
This is for my own use in BOINC-wide teams.
It must work even if account/team creation are disabled
(as they are in the BOINC-wide teams site).
To do this, I moved the <disable_team_creation> check out of make_team()
and moved it to the existing places that call make_team().
The logic now matches that of make_user().
Except for very specific cases, strncpy() should never be used.
It can result in a non-terminated string.
Also replace strncat() with strlcat(); the latter is simpler
because you don't have to calculate remaining buffer space.
There was a 20-30 second delay between exclusive app exit
and resuming tasks. This was excessive.
Reduce it to 5-15 sec (uncertainty is because we
check exclusive apps every 10 sec)
Apologies. My initial code didn't close the connections to the X
displays after opening them. I had thought that falling out of scope
would close the connection automatically. However, thanks to a bug
report by Dan Merillat that I was able to replicate, I now know better:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=812835
This simple adjustment closes the connection to the display (if a
connection succeeded in the first place; if XOpenDisplay() failed, it
returns NULL and there is no connection). Testing on my end shows that
this resolves the issue of the boinc client piling up new connections to
X servers.
A user had entered a string in one of the project prefs image URL
fields containing ^Z. Windows treats this as EOF and the parse
of the scheduler reply fails.
Soluation: open the scheduler reply file in "rb" mode rather than "r"