smallrye-graphql icon indicating copy to clipboard operation
smallrye-graphql copied to clipboard

Redeploy on WildFly with the GraphQL Feature Pack should reload the config

Open t1 opened this issue 3 years ago • 5 comments

When we redeploy a war on a WildFly with an update to the microprofile-config.properties concerning MP GraphQL, e.g. mp.graphql.showErrorMessage, then the changes don't get applied; it needs a full restart for that.

I've created a reproducer on https://github.com/t1/graphql-config-reload-reproducer including instructions for reproducing.

t1 avatar Oct 13 '22 14:10 t1

I'm not sure but this might be because, as far as I remember, WildFly's microprofile capabilities officially support only single- deployment scenarios, thus support for running multiple MicroProfile deployments in a single WF instance (and also redeploying a single deployment) are best-effort, because MicroProfile is designed for microservices (and thus MP implementations tend to use static variables for storing state, because it is easier and more performant, but it causes clashes between applications, because they will all see the same static state). That said, I'm putting some limited effort into supporting multiple deployments with GraphQL (generally it works, with some exceptions) but this could be a limitation in the MP Config subsystem. I'll have to dig into it to find out if it's something in the config subsystem that we can't easily work around on GraphQL side, or maybe it's some sort of issue on the GraphQL side that we can fix, I don't know yet.

jmartisk avatar Oct 18 '22 08:10 jmartisk

I should also add that if there's a danger of applications sharing the same static state (or one redeployed application receiving some outdated state from the previous deploy), there's a danger of security-related issues spawning from that, so it's highly unrecommended.

jmartisk avatar Oct 18 '22 09:10 jmartisk

Actually, we deploy only a single artefact to every WildFly, so this is not the problem. Only redeploying doesn't update the GraphQL settings. I haven't double-checked thoroughly, but I understand that this works with other MP Config settings.

t1 avatar Oct 18 '22 12:10 t1

Yeah but redeploying also counts as multiple deployments in this regard. If it works correctly with other MP Config settings though, it's probably something that we can fix in SmallRye GraphQL.

jmartisk avatar Oct 18 '22 13:10 jmartisk

I've updated the reproducer to show how updates to the config for MP REST Client works after a redeploy, but that may not be comparable, as it's a client, not a server. So I've also tried to add tags to MP Metrics via MP Config mp.metrics.tags, but it doesn't work... I probably do something wrong.

t1 avatar Nov 29 '22 07:11 t1