Commit cb3741f
committed
playground: use the correct contexts for sandbox requests
The sandbox code was incorrectly using the request context instead of
the build context when trying to determine if there was a
DeadlineExceeded error. This would manifest to the user as a blank
response in the build output, rather than the correct error.
Additionally, the sandbox code was using the incorrect context for
running the binary. This means we were not correctly enforcing
maxRunTime.
Finally, tests do not pass with a maxRunTime of 2 seconds on my machine,
and it's unclear what impact enforcing this would have on production
code. I've increased it to 5 seconds. It would be prudent to add metrics
here to determine how user programs are impacted in a follow-up issue.
Updates golang/go#25224
Updates golang/go#38052
Change-Id: I59aa8caeb63a9eec687bfbe4f69c57f71a13440d
Reviewed-on: https://go-review.googlesource.com/c/playground/+/227350
Reviewed-by: Andrew Bonventre <[email protected]>
Reviewed-by: Bryan C. Mills <[email protected]>1 parent 15e9685 commit cb3741f
1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
423 | | - | |
| 423 | + | |
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
| |||
454 | 454 | | |
455 | 455 | | |
456 | 456 | | |
457 | | - | |
| 457 | + | |
458 | 458 | | |
459 | 459 | | |
460 | 460 | | |
| |||
487 | 487 | | |
488 | 488 | | |
489 | 489 | | |
490 | | - | |
| 490 | + | |
491 | 491 | | |
492 | 492 | | |
493 | 493 | | |
| |||
0 commit comments