Commit Graph

102 Commits

Author SHA1 Message Date
David Anderson 2eb2b63b25 client: print message if do starvation AM RPC 2018-04-09 18:14:53 -07:00
David Anderson f38a5d67e5 client: fix logic for assigning sched_req_no_work:
if we didn't ask for work, don't change it
2018-04-09 11:47:42 -07:00
David Anderson 644f0ae6ba Debug and finish starvation prevention for dynamic AMs.
- Add an official notion of dynamic AM.
  Conveyed in AM reply message, stored in AM account file.
- Report accounting info only to dynamic AMs
- Fix bug where account info file wasn't written for AMs using authenticators
- In handling GUI RPC to do AM RPC, use info for current AM, e.g. if it's dynamic
2018-04-08 19:46:39 -07:00
David Anderson 99dd146bbb client: if using a dynamic AM and have idle resources, tell the AM
See issue #2452.
If using a dynamic AM, the client may starve, e.g. because
the assigned projects are down.
Detect this, and send "starvation RPCs" to the AM
giving details about the situation.
But don't do this too often; use exponential backoff.
2018-04-07 15:42:19 -07:00
David Anderson 40dccf9168 client: debug use of authenticators with account managers 2018-03-09 21:55:45 -08:00
David Anderson 99fbb26598 client: if account manager sends auth, use that instead of name/passwd
Previously, the credentials in account manager requests
were login name and password hash.
We need to keep this for compatibility with BAM and GR,
but it has problems:
- users can't change AM password
- password hash is stored on client and sent with each AM request

Solution: AM reply can include authenticator instead of name/passwd.
If so, store and use that.

Also: login_token_lookup.php needs to return auth instead of weak auth,
for both projects and AMs.
Weak auths are invalidated when user changes password.
2018-03-09 15:37:33 -08:00
David Anderson d20f016b60 client: include platform names in account manager request
This lets AMs like TBD make better meta-scheduling decisions
2017-12-08 00:38:27 -08:00
David Anderson 9f5c247adf client: extensions, fixes to account manager functionality
when handling an AM repy:
- check URL signature only for projects being attached.
- clear dont_request_more_work, detach_when_done if not present in reply

Store disk usage and share in state file; report to AM
2017-09-15 14:42:51 -07:00
David Anderson 89248f56c9 Merge pull request #2074 from BOINC/am_parse_fix
Fix parsing of AM reply messages
2017-08-25 15:35:42 -07:00
David Anderson 8821ff6e8c Merge branch 'master' of github.com:BOINC/boinc 2017-08-18 01:33:46 -07:00
David Anderson 080df0da0a client: fix keyword parse in AM account file 2017-08-18 01:33:16 -07:00
David Anderson c5281d0a4d client: fix keyword parsing 2017-08-16 17:17:51 -07:00
David Anderson 870d34ad03 Fix parsing of AM reply messages
- use std::string instead of malloced array for ACCT_MGR_OP::global_prefs_xml
- use copy_element_contents() instead of dup_element_contents()
  to get global prefs.
  The latter uses fgets instead of fgetc,
  so it requires that close tag be on a line by itself.
  TODO: don't use fgets anywhere in XML parsing.
- fix a bug in copy_element_contents() where it consumes an extra character
2017-08-14 14:46:30 -07:00
David Anderson 6fc116012b client: code cleanup, no functional change 2017-07-22 00:15:40 -07:00
David Anderson 5add5fda1d client: update keyword handling
new keyword model:
- keywords as identified by integer IDs
- instead of being treated as opaque data,
    the keyword XML is now parsed by the client.

This is a first step: pass keywords from AM to client to scheduler,
so that they can be used in job filtering.
Displaying keywords in the client will come later.
2017-07-15 19:05:23 -07:00
David Anderson 34ccd8b19c client: bug fix in acct mgr logic 2017-06-15 19:30:49 -07:00
David Anderson cd9437b8b1 client: account-manager-related changes
- If using an AM, show its name on startup
- accept either <error> or <error_msg> in AM reply; document
- If using an AM and get a request to contact a different AM,
  return "detach first" error (relevant if using boinccmd)
- Add mechanism for AM to send opaque data to schedulers
2017-06-14 22:53:16 -07:00
David Anderson 4a9cc3e725 client/lib: code shuffle preparatory to adding app_config GUI RPC 2017-05-11 01:53:50 -07:00
David Anderson 63ed0f47f3 client: change "njobs_fail" back to "njobs_error"
The change broke compatibility, and there wasn't a good reason for it.
2017-03-26 19:48:42 -07:00
David Anderson 10bcf5ed88 client: send acct keys to acct manager only for projects attached via acct mgr. 2017-03-17 15:08:50 -07:00
David Anderson 7294138ddb client: finish fix for AM prefs
(BAM! used mixed http/https, needed to strip that off)
2017-02-02 02:38:22 -08:00
David Anderson 938fad105d client: finish last commit 2017-02-02 02:20:35 -08:00
David Anderson 4427f3646d client: revert misguided attempt to persist acct mgr info 2017-02-02 02:17:55 -08:00
David Anderson f8e19d61f5 client: fix compile warning 2017-01-27 11:43:38 -08:00
David Anderson eb10e0d8ba Merge branch 'master' of https://github.com/BOINC/boinc 2017-01-26 20:21:01 -08:00
David Anderson 1be5229c18 client: when attaching to an AM, see if account file exists
... and if so pass its opaque data.
This avoids creating a new host record in the AM DB
if a user quits and rejoins the AM
2017-01-26 20:20:49 -08:00
David Anderson 7cb58b5268 client: include # GPUs in <host_info> XML, including acct mgr requests 2017-01-12 13:15:42 -08:00
David Anderson 536d89f228 Merge branch 'master' of https://github.com/BOINC/boinc 2017-01-04 13:34:37 -08:00
David Anderson b949b87ac2 client: njobs_fail, not njobs_error 2017-01-04 13:34:26 -08:00
David Anderson c44a2b45dc client: tweak account manager logic
1) store AM and login info in files whose names include the AM URL,
    and don't delete them when detach from the AM.
    That way if user detaches and reattaches,
    we'll still have the opaque data (e.g. host ID)
    and the AM won't create a new host.
2) If the AM RPC has an error on the server,
    it probably won't return AM name, signing key, or opaque data.
    In that case hang onto the old ones.
2017-01-04 13:29:10 -08:00
David Anderson 958c89c1e7 client: account per-project CPU and GPU usage; report to account managers
Also report per-project #jobs success/failure
2016-12-27 23:48:37 -08:00
David Anderson 5710a5e8c8 client: report project-level REC to account managers 2016-12-21 22:17:50 -08:00
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
David Anderson 1fe02c9d4f GUI RPC: enclose message bodies in CDATA to avoid XML parse errors
for messages containing "<".

Also strip off <?xml tag from project config
to make GUI RPC reply valid.
2016-04-05 13:14:21 -07:00
Artem Vorotnikov 7a6b5ee204 Work around invalid XML in logs
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.
2016-03-23 15:26:52 +03: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 59b5bf2f71 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 23:34:18 -05:00
David Anderson cf607534a9 Client: acct manager fixes
- honor suspend flag for first-time attaches
- do initial RPC even if suspended (to get project name etc).
2015-12-20 01:58:30 -08:00
Christian Beer 9c7bf33c45 initialize fields in constructors
fixes CID 27935, 28004 and 27948 found by Coverity Scan
2015-10-19 18:23:55 +02:00
David Anderson 979d726c9f client: debug account manager fix from 2 days ago 2015-01-19 09:39:13 -08:00
David Anderson e67c6a12e1 client: fix bug where project erroneously marked as attached via acct mgr 2015-01-18 11:43:46 -08:00
David Anderson 1e2fcb4b68 client/lib: change CONFIG to CC_CONFIG, config to cc_config.
Eliminates ambiguity of "config" global var, which is used in server code.
This confuses IDEs that are looking at all the code at once.
2014-05-08 00:51:18 -07:00
David Anderson cfffccac35 client: if acct mgr RPC gets HTTP error, don't create a notice
Such an error typically means the acct mgr server is down.
2014-05-05 12:13:32 -07:00
David Anderson 6a8eab73cd replace tab characters with spaces 2014-05-01 21:03:49 -07:00
David Anderson db9abb12ce client: fix bug in parsing <no_rsc> from account managers
Also Manager message tweak
2014-04-17 00:23:44 -07:00
David Anderson 1dac077a05 client: message tweak 2013-08-08 10:59:49 -07:00
David Anderson 59ba61b323 client (Android): don't use network preferences
Many Android users had existing preferences with settings like
"don't compute when idle" that make sense for PCs but not mobile devices.
When this pref is enforced on Android, no computing happens
and user confusion results.
We're addressing this by using only local prefs on Android.
We considered other approaches - e.g. having a "mobile" venue -
but they're too complex.
2013-08-04 15:13:26 -07:00
David Anderson 9d43d18011 client: include project resource shares in account manager request message 2013-08-03 13:13:54 -07:00
David Anderson 9978c40bcb client: fix bug where <no_project_notices> from account manager didn't work 2013-07-02 20:53:50 -07:00
David Anderson 846b8c7757 all components: change strcpy() to strlcpy() when possible.
This commit should cover the client and manager code.
2013-06-03 20:24:48 -07:00