-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce log_message action. #1906
Conversation
Hmm. I will try to duplicate it tomorrow. |
I tested if this fixes the problem: diff --git a/server/fishtest/actiondb.py b/server/fishtest/actiondb.py
index f12573b..a832128 100644
--- a/server/fishtest/actiondb.py
+++ b/server/fishtest/actiondb.py
@@ -156,6 +156,7 @@ schema = union(
"message": union("blocked", "unblocked"),
},
{
+ "_id?": ObjectId,
"action": "log_message",
"username": str,
"message": str, But the issue is still there: Mar 04 12:48:19 dfts-0 pserve[14185]: ^^^^^^^^^^^^^^^^^^^^^
Mar 04 12:48:19 dfts-0 pserve[14185]: File "/home/usr00/fishtest/server/fishtest/api.py", line 554, in update_task
Mar 04 12:48:19 dfts-0 pserve[14185]: result = self.request.rundb.update_task(
Mar 04 12:48:19 dfts-0 pserve[14185]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 04 12:48:19 dfts-0 pserve[14185]: File "/home/usr00/fishtest/server/fishtest/rundb.py", line 1322, in update_task
Mar 04 12:48:19 dfts-0 pserve[14185]: return self.sync_update_task(worker_info, run_id, task_id, stats, spsa)
Mar 04 12:48:19 dfts-0 pserve[14185]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 04 12:48:19 dfts-0 pserve[14185]: File "/home/usr00/fishtest/server/fishtest/rundb.py", line 1463, in sync_update_task
Mar 04 12:48:19 dfts-0 pserve[14185]: self.check_results(run, run_id, task_id)
Mar 04 12:48:19 dfts-0 pserve[14185]: File "/home/usr00/fishtest/server/fishtest/rundb.py", line 1495, in check_results
Mar 04 12:48:19 dfts-0 pserve[14185]: self.actiondb.log_message(
Mar 04 12:48:19 dfts-0 pserve[14185]: File "/home/usr00/fishtest/server/fishtest/actiondb.py", line 368, in log_message
Mar 04 12:48:19 dfts-0 pserve[14185]: self.insert_action(
Mar 04 12:48:19 dfts-0 pserve[14185]: File "/home/usr00/fishtest/server/fishtest/actiondb.py", line 378, in insert_action
Mar 04 12:48:19 dfts-0 pserve[14185]: validate(schema, action, "action") # may raise exception
Mar 04 12:48:19 dfts-0 pserve[14185]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 04 12:48:19 dfts-0 pserve[14185]: File "/home/usr00/fishtest/server/env/lib/python3.11/site-packages/vtjson.py", line 344, in validate
Mar 04 12:48:19 dfts-0 pserve[14185]: raise ValidationError(message)
Mar 04 12:48:19 dfts-0 pserve[14185]: vtjson.ValidationError: action['action'] (value:'log_message') is not equal to 'failed_task' and action['action'] (value:'log_message') is not equal to 'crash_or_time' and action['message'] is not in |
This may be used to give internal errors in the logic of Fishtest maximum visibility. This action is currently used in two places: - if a finished run does not validate; - if check_results finds a discrepancy between the incrementally updated results and the computed results in a finished run. Currently both errors are logged but otherwise they are treated silently. Another application in the future might be to log certain worker errors which happen before a task is requested (e.g. failure to be able to run cutechess-cli). While at it, replace all occurences of _validate(), which returns an error string on non-validation, by the more Pythonic validate(), which throws an exception instead.
Latest commit fixes the issue I think. |
Looks good on DEV, triggering the log_message with that trick the server correctly stops the run and writes in the Events log Here is the server log: Mar 04 16:33:06 dfts-0 pserve[30696]: Request_task: refresh queue
Mar 04 16:34:59 dfts-0 pserve[30696]: Request_task: refresh queue
Mar 04 16:35:23 dfts-0 pserve[30696]: Check_results: task 65e5e886647801fd33db0f46/2 wins results mismatch: 618/618
Mar 04 16:35:23 dfts-0 pserve[30696]: Check_results: task 65e5e886647801fd33db0f46/2 losses results mismatch: 172/172
Mar 04 16:35:23 dfts-0 pserve[30696]: Check_results: task 65e5e886647801fd33db0f46/2 draws results mismatch: 450/450
Mar 04 16:35:23 dfts-0 pserve[30696]: Check_results: task 65e5e886647801fd33db0f46/2 crashes results mismatch: 0/0
Mar 04 16:35:23 dfts-0 pserve[30696]: Check_results: task 65e5e886647801fd33db0f46/2 time_losses results mismatch: 0/0
Mar 04 16:35:23 dfts-0 pserve[30696]: Check_results: task 65e5e886647801fd33db0f46/2 pentanomial value 0 results mismatch: 4/4
Mar 04 16:35:23 dfts-0 pserve[30696]: Check_results: task 65e5e886647801fd33db0f46/2 pentanomial value 1 results mismatch: 47/47
Mar 04 16:35:23 dfts-0 pserve[30696]: Check_results: task 65e5e886647801fd33db0f46/2 pentanomial value 2 results mismatch: 183/183
Mar 04 16:35:23 dfts-0 pserve[30696]: Check_results: task 65e5e886647801fd33db0f46/2 pentanomial value 3 results mismatch: 271/271
Mar 04 16:35:23 dfts-0 pserve[30696]: Check_results: task 65e5e886647801fd33db0f46/2 pentanomial value 4 results mismatch: 115/115
Mar 04 16:35:25 dfts-0 pserve[30696]: Request_task: refresh queue
Mar 04 16:36:35 dfts-0 pserve[30696]: Request_task: refresh queue |
PROD updated, thank you @vdbergh :) |
https://tests.stockfishchess.org/actions?action=log_message&user=&text= The "Source" field has a wrong link to https://tests.stockfishchess.org/user/fishtest.system |
Perhaps it would be best to simply create this user. |
Ok, let me try on DEV |
But I am noticing that the run schema needs to be updated :) |
The problem is that a user without CPU/tests contributions is delete after a while. |
I updated the schema to account the multiple nets in #1902 |
|
Ok I see. No problem then. |
Already reported to the SF maintainers group when I refactored the script, but at time the decision was to be sure to not delete users with some contribution. I made clear that a user get a contribution only if the run finishes. I warned as well that we already deleted some users with contribution to never finished runs (and perhaps some old users with real contribution):
|
Ah I see, I'm dealing with the contributor list as if it is user list because there is no user list.
|
What about reloading the page if clicking on the link diff --git a/server/fishtest/templates/actions.mak b/server/fishtest/templates/actions.mak
index 8a15efb..2f6d84d 100644
--- a/server/fishtest/templates/actions.mak
+++ b/server/fishtest/templates/actions.mak
@@ -177,3 +177,12 @@
document.getElementById('restrict').value =
('${request.GET.get("action") if request.GET.get("action") != None else ''}');
</script>
+
+<script>
+ document.querySelectorAll('a[href$="/user/fishtest.system"]').forEach(function(link) {
+ link.addEventListener('click', function(event) {
+ event.preventDefault();
+ location.reload();
+ });
+ });
+</script> |
Better to to not link that with an if statement here while rendering or check if the user exists
|
This may be used to give internal errors in the logic of Fishtest maximum visibility.
This action is currently used in two places:
if a finished run does not validate;
if check_results finds a discrepancy between the incrementally updated results and the computed results in a finished run.
Currently both errors are logged but otherwise they are treated silently.
Another application in the future might be to log certain worker errors which happen before a task is requested (e.g. failure to be able to run cutechess-cli).
While at it, replace all occurences of _validate(), which returns an error string on non-validation, by the more Pythonic validate(), which throws an exception instead.