Closed chefhoobajoob closed 2 years ago
As @chefhoobajoob noted graalvm file system is expected to be set per graal context, while we share a global FS. This sharing may be the root cause of the wrong thread exception.
We should rewrite the filesystem implementation to use a correct vert.x context as this ensures that we also are on the right thread most of the times.
See here for a reproducer using rxjs to illustrate. If two or more verticle instances are deployed that each use one or more large/modularized-enough npm packages in common, then the second verticle instance to attempt to load one of these packages' modules will result in a graalvm PolyglotException citing either a multi-threaded access or wrong context assertion error.
Reproducible on es4x 0.17.0, vertx 4.2.4