Skip to content

Conversation

@drgrice1
Copy link
Member

When the gateway test option "Number of Graded Submissions per Test" is set something more than one or even worse to 0, then the javascript auto submit submits continuously until all submissions are used up or the full grace period expires. That can crash a server.

To test this create a gateway quiz and just use the default setting of 0 for that option. I recommend setting the test time limit to something small (I used 0.05 for 3 seconds), and setting $gatewayGracePeriod = 11; in localOverrides.conf. When the time is up on the develop branch you will see the quiz start submitting, and continue to do so for the next 10 seconds and the full gatewayGracePeriod is expired.

With this pull request, you will see the test only submit once.

See https://webwork.maa.org/moodle/mod/forum/discuss.php?d=8228.

When the gateway test option "Number of Graded Submissions per Test" is
set something more than one or even worse to 0, then the javascript auto
submit submits continuously until all submissions are used up or the
full grace period expires.  That can crash a server.

To test this create a gateway quiz and just use the default setting of 0
for that option.  I recommend setting the test time limit to something
small (I used 0.05 for 3 seconds), and setting `$gatewayGracePeriod = 11;`
in localOverrides.conf.  When the time is up on the develop branch you
will see the quiz start submitting, and continue to do so for the next
10 seconds and the full gatewayGracePeriod is expired.

With this pull request, you will see the test only submit once.
Copy link
Member

@taniwallach taniwallach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the fix and solves the problem.
I think a hotfix to WW 2.17 should be made to address the bug in the current release.

@drgrice1
Copy link
Member Author

I would be okay with that. Do others agree? It is generally not something that probably happens much, as I don't think that students typically leave the browser open with a test un-submitted for two minutes after time has run out. However, it can be rather bad when that does happen.

@taniwallach
Copy link
Member

The bug crashed a server due to memory issues caused by the repeated commits... so even if it is an edge case - preventing an accidental DoS seems to justify a hotfix in my opinion.
@pstaabp @drdrew42 @Alex-Jordan - please put in your opinions.

Copy link
Member

@pstaabp pstaabp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the issue. And looks like a hot fix is already a PR.

@pstaabp pstaabp merged commit f815f13 into openwebwork:WeBWorK-2.18 Apr 27, 2023
@drgrice1 drgrice1 deleted the bugfix/prevent-gateway-multi-auto-submit branch April 27, 2023 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants