Closed UglyHobbitFeet closed 4 years ago
This is a known issue with executeBlocking and graaljs. Currently I have no fix for it as it requires a different way to schedule blocking tasks without calling back to the original thread.
Hi, I've just test this with:
import { ConfigRetriever } from '@vertx/config';
import { ConfigStoreOptions, ConfigRetrieverOptions } from '@vertx/config/options';
const fileStore = new ConfigStoreOptions()
.setType('file')
.setFormat('properties')
.setConfig({ 'path': 'foobar.properties' });
const retriever = ConfigRetriever.create(vertx, new ConfigRetrieverOptions().addStore(fileStore));
retriever.getConfig(ar => {
if (ar.failed()) {
console.trace(ar.cause());
} else {
console.log('From Future:', JSON.stringify(ar.result()));
}
});
And my package.json:
{
"name": "config",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "es4x test index.test.js",
"postinstall": "es4x install",
"start": "es4x"
},
"dependencies": {
"@vertx/core": "^3.9.0",
"@vertx/config": "^3.9.0"
}
}
With the following properties:
key=value
And cannot reproduce the issue anymore. I'll close it and mark it as fixed.
Good to know! For what it's worth, I ran into a bunch of these threading errors when using the vertx-mongo 3.8.5 yesterday. I can try with 3.9.0/0.11 and see if things are different
On Thu, Apr 2, 2020 at 5:25 AM Paulo Lopes notifications@github.com wrote:
Closed #113 https://github.com/vert-x3/vertx-config/issues/113.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/vert-x3/vertx-config/issues/113#event-3191328547, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALBDS7QJVWUYZFOBFB4BOITRKRKZFANCNFSM4K4GWA4A .
The issue (to some degree) still exists and I opened a ticket in vertx/mongo https://github.com/vert-x3/vertx-mongo-client/issues/224
I have started to try and use the config retriever to read in a properties file for vertx. The code looks like below:
However, when I launch the VM (npm run build;npm start;) I start seeing the following two messages in the console:
and
both with the same stacktrace of
FYI my current workaround is to use
and to manually parse the file for properties. Doing this causes no multi-threading issues.
FWIW I'm on:
Is it possibly linked to https://github.com/graalvm/graaljs/issues/59, and if so, what would the fix be?