Commit Graph

20 Commits

Author SHA1 Message Date
Maximilian Paß
ab938bfc22 Refactor MemoryLeakTestSuite
as we identified two issues where the goroutine count from before differs from after the test.

1) It seemed like a Go runtime specific Goroutine appeared in rare cases before the test. To avoid this, we introduced a short timeout before looking up the Goroutines.
Another solution might be to do the lookup twice and check if the count matches.

2) A Goroutine that periodically monitors some storage unexpectedly got closed in rare cases. As we could not identify the cause for this, we removed the leaking Goroutines by properly cleaning up.
2024-02-28 11:52:51 +01:00
Maximilian Paß
6159f2a045 Fix Goroutine Leak of Nomad execute command
that was triggered when [the execution timeout got exceeded, the runner got destroyed, or the WebSocket connection to CodeOcean closed] and the Allocation did not react to the SIGQUIT within the grace period.
2023-09-11 13:44:29 +02:00
Maximilian Paß
3abd4d9a3d Refactor all tests to use the MemoryLeakTestSuite. 2023-09-11 13:44:29 +02:00
Maximilian Paß
bfb5977d24 Destroy runner on allocation stopped
Destroying the runner when Nomad informs us about its allocation being stopped, fixes the error of executions running into their timeout even if the allocation was stopped long ago.
2023-07-21 15:30:21 +02:00
Maximilian Paß
7dadc5dfe9 Refactor Nomad Command Generation.
- Abstracting from the exec form while generating.
- Removal of single quotes (usage of only double-quotes).
- Bash-nesting using escaping of special characters.
2023-03-14 23:42:19 +01:00
Maximilian Paß
5d54b0f786 Fix wrong environment id at monitoring
data for created or updated environments.
2022-10-24 13:15:14 +02:00
Sebastian Serth
1a5a49d7c8 Explicitly switch user for code execution.
Co-authored-by: Maximilian Pass <maximilian.pass@student.hpi.uni-potsdam.de>
2022-09-24 23:09:23 +02:00
Maximilian Paß
498e8f5ff5 #110 Refactor influxdb monitoring
to use it as singleton.
This enables the possibility to monitor processes that are independent of an incoming request.
2022-07-01 15:29:31 +02:00
Maximilian Paß
203d5a3a4f #155 refactor and synchronise writing to CodeOcean. (#174)
* #155 refactor and synchronise writing to CodeOcean.

* Reduce complexity of input parsing.

* Update typo in internal/api/ws/codeocean_writer.go

Co-authored-by: Sebastian Serth <MrSerth@users.noreply.github.com>
2022-06-26 20:19:23 +02:00
Maximilian Paß
8feffdae3a Add initial structure of influxdb monitoring. 2022-04-18 13:17:49 +02:00
Maximilian Paß
dd41e0d5c4 Generate structures for an AWS environment and runner 2022-02-28 14:54:40 +01:00
Maximilian Paß
0ef5a4e39f Make Execution Environment interface Nomad independent 2022-02-28 14:54:40 +01:00
Maximilian Paß
d57a0c07b8 Implement review suggestions 2021-12-22 17:30:16 +01:00
Maximilian Paß
f3929cbf50 Fix webSocket error
that was introduced by closing the WebSocket connection without stopping the inputLoop.
2021-12-16 15:05:47 +01:00
Maximilian Paß
feefe2c1ed Fix third goroutine leak and refactor proxy cancellation.
Fix goroutine leak in the Read function of the codeOceanToRawReader: Blocking Select statement.
2021-12-14 13:24:53 +01:00
Maximilian Paß
c8c5357b8c Rename module for GitHub 2021-07-30 16:43:05 +02:00
sirkrypt0
36dc99f019 Don't embed the execution.Storer interface into a runner
Previously, the execution.Storer interface was embedded in the Runner interface.
However, this resulted in calls like runner.Add(...) to add an execution to the
store which is kind of ugly. Thus, we decided to add only the required functions to
the runner interface and make the execution.Storer a field of the implementation.
2021-07-30 14:28:06 +02:00
sirkrypt0
bd14b1e181 Move execution storage to new package 2021-07-30 14:26:44 +02:00
Konrad Hanff
8d24bda61a Send SIGQUIT when cancelling an execution
When the context passed to Nomad Allocation Exec is cancelled, the
process is not terminated. Instead, just the WebSocket connection is
closed. In order to terminate long-running processes, a special
character is injected into the standard input stream. This character is
parsed by the tty line discipline (tty has to be true). The line
discipline sends a SIGQUIT signal to the process, terminating it and
producing a core dump (in a file called 'core'). The SIGQUIT signal can
be caught but isn't by default, which is why the runner is destroyed if
the program does not terminate during a grace period after the signal
was sent.
2021-07-29 10:28:47 +02:00
sirkrypt0
8b26ecbe5f Restructure project
We previously didn't really had any structure in our project apart
from creating a new folder for each package in our project root.
Now that we have accumulated some packages, we use the well-known
Golang project layout in order to clearly communicate our intent
with packages. See https://github.com/golang-standards/project-layout
2021-07-21 12:55:35 +02:00