-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make sure hot deployment works after a failed server start in an application with non-default http port #4934
Conversation
…ion" class name suffixes
… allow for hot deploying any fixes that caused the server start failure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the first commit, what you did is remove Config/Configuration before dashifying, right? Is that what failed before because the dashification was hidding the capitalized C in the string replacement? I have to admit I have a hard time following the core of the changes.
For second commit, it's not make sure the proper set of files are listened to, correct?
private static Set<String> supportedClassNameSuffix; | ||
|
||
static { | ||
final Set<String> suffixes = new HashSet<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind avoiding using final on local variables. I don't think we use that approach elsewhere and in your case it shows artificial line changes compared to the original code which makes it harder to read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@emmanuelbernard, I'll keep that in mind for unchanged lines going forward.
@jaikiran I tested it but it seems to still only react on port 8080 upon failure.
So the patch does not seem to address the problem |
@emmanuelbernard I am surprised by your comment, it tested it and it worked on my case. The curl on localhost:8082 triggered the reload and the result was good. |
Year I am seeing the same results even after What I did is
and on an new app did the steps I mentioned above. And boom only reacts to 8080 |
Maybe @FroMage you could be the judge, is that me scrambling something or is the PR having an issue? |
I tested this locally, it works for me. |
@emmanuelbernard you are using 999-SNAPSHOT in the app you are testing right? |
@emmanuelbernard I am just going to merge this, as we have 3 others confirming that is fixes their problem (and it is clearly fixing a real problem). If you still have problems they are likely something different. |
We must be testing different things because when I followed @emmanuelbernard's scenario, I observed the exact same behavior he did: The application was listening on 8081 instead of 8080. |
@geoand 8081 is the correct behaviour. |
@stuartwdouglas sorry, in my comment above I meant to say that |
@stuartwdouglas if you feel it’s fixing something sure. Push. I’ll try and reproduce with a clean scenario with another issue tomorrow. |
So basically there was different behaviour depending on if the failure happened during augment or runtime. Runtime sets config properties globally, so application.properties was still available. If it failed in augment it was only attached to the current CL, which was not present when the startup was happening |
So to reproduce this you needed to both use application.properties rather than a system property, and pick a failure that would be reported at build time rather than runtime. |
Sorry @emmanuelbernard, after I submitted this PR, I just called it a day and am only now checking these messages.
Yes, that was one part of the reason why hot deployment wasn't kicking in correctly. What was happening was the logic in
So the first commit in this PR fixed these 2 issues.
The second commit in the PR involves the |
This should fix the issue reported in #4815
This includes 2 commits - one which fixes the parsing of the configuration options in
ConfigInstantiator
which was resulting in not using the configured port in case of failed start. ThisConfigInstantiator
is only used in this specific failed server start case and for limited use case and thus explains why such a basic issue wasn't noticed in this one so far.The second commit in this PR includes a change in
VertxHttpRecorder
to make sure the hot deployment handler is setup even after the server failed to start.Given the nature of this change, there isn't any easy way to add a test to this one. I have manually tried a bunch of use cases with this change. That includes, using non-default http port and then starting Quarkus such that it fails during startup and then updating the application.propreties to make sure the change fixes the startup and then issuing a request to it. Went fine. Have also tried the usual successful cases and those too went fine.