Open threo9 opened 3 years ago
If we write the results to the file after each judging, it might cause large amount of disk I/O, which is not good.
To solve it, as early as in LemonPlus, it is supported to save file manually.
It's in the menu of file
(maybe, I remember). I can't remember if ctrl + s
works.
If we write the results to the file after each judging, it might cause large amount of disk I/O, which is not good. To solve it, as early as in LemonPlus, it is supported to save file manually. It's in the menu of
file
(maybe, I remember). I can't remember ifctrl + s
works.
Emmm,it seems that LemonLime can also save manually. But I don't think writing the results to the file after each judging will cause large amount of disk I/O for a common contest. like a test in a team,Most cdf files are very small,so I don't think the amount of disk I/O will be large enough to have an impact to normal using.
Think about this situation:
Lemon is running a large contest and the system or lemon crashed due to some reason (oom, malicious code, etc)
The result should be auto-saved (after each run, or after a delay)
I think auto-saving for each 5min and create a backup for the old one(manually saved version) is a good way to handle this.
I think auto-saving for each 5min and create a backup for the old one(manually saved version) is a good way to handle this.
I agree with u, an autosave at regular time intervals is a good choice.
But I think the work to change the file format is more important now.
As cena
, if we divide each player's result file, problemset file, contest file and maybe more, we can save each instead of saving the whole contest. Than the immediate saving function can be reached easily.
Too many files also leaks performance. I still think a simple json/xml/yaml file is better.
@undefined-moe
Let me start with something that happened in the past:
Maybe I'm a pupil that time.
We haved a contest and we have judged for dozens of minutes,but someone usedsystem("shutdown ")
then we have to re-judge all the codes again.
I think @Dust1404 's suggestion is feasible,but will it increase the difficulty of code to implement the operation of summing up grades?
This is a problem related to sandbox module, not contest management module.
Oh,we used lemon that time.
This is a problem related to sandbox module, not contest management module.
But lost results show it's defects of saving mechanism
ndbox module, not contest management module.
@undefined-moe btw,can problems like this be solved now?
btw,can problems like this be solved now?
maybe by using something like sandboxie on windows, cgroup on linux ?
and I have an idea: create a .progress
file when judging, write pid to the first line, and after each contestant's code finished running, append the result to the file. And when lemonlime starts, check if the file exists, then check if the pid is running.
if pid is running, just display an error said the contest is locked by another lemonlime process,
and if not, display a prompt: "Found a uncompleted progress, do you want to load it and continue?" with "Yes", "Yes, but skip this contestant", "No" options to user.
btw,can problems like this be solved now?
maybe by using something like sandboxie on windows, cgroup on linux ?
and I have an idea: create a
.progress
file when judging, write pid to the first line, and after each contestant's code finished running, append the result to the file. And when lemonlime starts, check if the file exists, then check if the pid is running. if pid is running, just display an error said the contest is locked by another lemonlime process, and if not, display a prompt: "Found a uncompleted progress, do you want to load it and continue?" with "Yes", "Yes, but skip this contestant", "No" options to user.
Sounds great !
Is this in progress? :thinking:
Is this in progress? :thinking:
I also want to ask this question, It's very useful, I think @undefined-moe
日常催更/xyx
Now results are written every 30s
It's useful when I forget to close the program but I want to share the contest directory with someone, Or I don't want to close the program at now. In previous versions,the cdr file may be recorded no results. We can write the results to CDF file immediately after each judging, then it will be easier to share the contest directory,I think.