I999 Add configurable execute grace periods for sandbox runs #1000
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of what the PR does
Add 2 new values to ContestInformation:
sandboxGraceTimeSecs
andsandboxInteractiveGraceMultiplier
. These integer values may be configured using thesystem.pc2.yaml
at contest load time, or the GUI Settings tab after a contest is configured. Default values are: 1 and 3 respectively.Change Executable to pad execution timers to wait additional time (grace time) for sandbox and interactive sandbox problems, where the sandbox will monitor the actual CPU time of the submission. The timers in PC2, in this case, are for Wall time to protect against sleeping/wall time consuming processes.
Cleaned up some comments that were wrong or had errors in them
Rearranged some code to initialize the timer delays earlier on since they are used in 2 places.
CI: While testing the new sandbox time grace periods, a couple of bugs were found in the SubmitSampleRunsPane (which is used to submit the judge's sample solutions by an administrator. The following were fixed/added to support SubmitSampleRuns:
Basically, these new configuration parameters replace constants that were used in Executable previously.
This PR is one of those cases where there appear to be lots of changes, but again, Eclipse has made many of them related to spaces or other syntax fixes in
ContestInformation.java
. Also, there were new modules added and one renamed, so they appear as a lot of differences as well.Issue which the PR addresses
Fixes #999
Environment in which the PR was developed (OS,IDE, Java version, etc.)
Windows 11/Ubuntu 22.04.1 (tested with both)
java version "1.8.0_321"
Java(TM) SE Runtime Environment (build 1.8.0_321-b07)
Java HotSpot(TM) 64-Bit Server VM (build 25.321-b07, mixed mode)
Precise steps for testing the PR (i.e., how to demonstrate that it works correctly)
Load the contest
Start the pc2server an administrator client.
Go to the "Configure Contest->Settings" tab.
Notice that the values for the Sandbox Grace Time added and Interactive problem time multiplier reflect the values added to the system yaml file:

Using the GUI, change the values to 1 and 3 respectively. (You can click the ? (what's this) buttons next to each value for a detailed description of what they do).
Shutdown the admin and the server
Restart the server and admin
Go to the "Configure Contest->Settings" tab and notice the values that were modified by the GUI have been saved.
