enso/engine
Hubert Plociniczak 13969abc92
Eliminate potential race-condition in PathWatcher (#8154)
The change eliminates a race-condition that can appear between the `PathWatcher` deregistering the last client (and shutting down) and `ReceivesTreeUpdatesHandler` receiving the termination message of that event. In between there could come a message towards the mentioned `PathWatcher` resulting in a timeout.

The scenario has become rather common in CI tests resulting in spurious failures. The problem could also be simulated by adding artificial `Thread.sleep` between sending the reply in `PathWatcher` and stopping the actor.

Fixes #8151.

# Important Notes
Example failure https://github.com/enso-org/enso/actions/runs/6642894609/job/18048711561?pr=8145
To simulate the scenario
```diff
diff --git a/engine/language-server/src/main/scala/org/enso/languageserver/filemanager/PathWatcher.scala b/engine/language-server/src/main/scala/org/enso/languageserver/filemanager/PathWatcher.scala
index 713cfe1182..88afac95cb 100644
--- a/engine/language-server/src/main/scala/org/enso/languageserver/filemanager/PathWatcher.scala
+++ b/engine/language-server/src/main/scala/org/enso/languageserver/filemanager/PathWatcher.scala
@@ -110,6 +110,7 @@ final class PathWatcher(

case UnwatchPath(client) =>
sender() ! CapabilityReleased
+      Thread.sleep(2000)
unregisterClient(root, base, clients - client)
```
2023-10-27 10:17:25 +00:00
..
interpreter-dsl-test/src/test/java/org/enso/interpreter/dsl/test Builtin methods handle some exceptions (#7494) 2023-08-07 16:42:15 +02:00
language-server Eliminate potential race-condition in PathWatcher (#8154) 2023-10-27 10:17:25 +00:00
launcher/src Add support for https and wss (#7937) 2023-10-12 00:03:34 +02:00
polyglot-api/src Translate IR to Java (#8145) 2023-10-26 07:31:08 +00:00
runner Add support for https and wss (#7937) 2023-10-12 00:03:34 +02:00
runtime Translate IR to Java (#8145) 2023-10-26 07:31:08 +00:00
runtime-instrument-common/src Translate IR to Java (#8145) 2023-10-26 07:31:08 +00:00
runtime-instrument-id-execution/src/main/java/org/enso/interpreter/instrument Fix initialization race-condition in runtime connector (#7985) 2023-10-13 10:03:27 +00:00
runtime-instrument-repl-debugger/src/main/java/org/enso/interpreter/instrument Improve undefined method error message on builtin types (#3907) 2022-11-30 13:37:17 +01:00
runtime-instrument-runtime-server/src/main/java/org/enso/interpreter/instrument Fix initialization race-condition in runtime connector (#7985) 2023-10-13 10:03:27 +00:00
runtime-language-epb/src/main/java/org/enso/interpreter/epb Support for Python libraries like numpy (#7678) 2023-08-30 06:10:18 +02:00
runtime-parser/src Translate IR to Java (#8145) 2023-10-26 07:31:08 +00:00
runtime-with-instruments/src/test Initialize suggestions database only once (#8116) 2023-10-21 20:32:13 +00:00
runtime-with-polyglot/src/test Initialize suggestions database only once (#8116) 2023-10-21 20:32:13 +00:00
README.md Add a markdown style guide (#1022) 2020-07-21 13:59:40 +01:00

The Enso Engine

The Enso engine is the codebase responsible for compiling and executing Enso code, as well as providing language server functionality to users of the language. It is subdivided into two major components:

  • Language Server: The Enso language service.
  • Polyglot API: The truffle-boundary safe API for communication between the language server and the runtime.
  • Runner: The command-line interface for Enso.
  • Runtime: The compiler and interpreter for Enso.