-
Notifications
You must be signed in to change notification settings - Fork 91
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
Server stopped after source code change in dev mode (Maven plugin) #1816
Comments
Hi, can you clarify what the problem is? Reading your issue, I'm not sure which of the following you're saying is wrong:
|
Hi. Sure, it is the second point: Open Liberty's Maven plugin should restart the server. |
Can you please explain a bit more about what led up to the restart? You changed the source..was it Java code, pom.xml, server.xml, some combination? For your first set of errors in the log.. are these the original, first relevant log entries here? Or are you saying that there was some other condition prior, which led to these exceptions as a consequence?
|
I'm just using the |
Sorry.. I hit the button before I finished typing my comment. Please take another look. In general, |
I was indeed changing Java code; specifically, code inside a method with an As far as I can tell, these were the first relevant log entries, yes. It isn't the first time I observe a mysterious server stop during development. It happens to me with some regularity, maybe once or twice a month, often without any exception in the vicinity. I'll post more details here when I see it again. |
Thanks for clarifying. Are you able to share more details from the full messages.log (or ffdc logs) from this last time that the server crashed? |
I couldn't see anything else of relevance in messages.log; I did not look into any other logs. They are gone now, unfortunately. |
Ok, thanks for looking. Well, I don't think we want to expand dev mode to monitoring the server and introducing an automated restart around the server. I think what we're left with then is understanding why did the original server crash to begin with ? I think we would need to see the content of the logs directory to understand that better, either the full logs directory provided via a support case if that is an option for you or whatever you can share publicly if not (maybe some excerpts from the messages.log and maybe some of the FFDC logs would be helpful enough). It would also help to include the console log from your Maven session (executing dev mode) as well. In any case, I'm going to close this for now, but please do reopen when you have more detail. Also going to transfer this back to the other repo since this has moved in the direction of more of a runtime issue than a liberty-maven-plugin issue. Thank you. |
It just happened again, as I was editing some test files. Please, have a look at a more complete messages.log. I have shortened it a bit (replaced a big chunk with "..."), and removed a few application-specific messages (which did not include exceptions). I would like to highlight how "The application app updated" was printed many times during the course of my development session (the last two of which can be seen) and, at one point, an unsolicited "Server shutdown requested" message is printed. The last FFDC file was "ffdc/ffdc_24.04.17_11.13.59.1.log" and did not contain much: a single exception that occurred around the time indicated by the filename. |
Do you have the output from the console where you ran |
My apologies, I don't anymore. (I thought the contents of messages.log were the same as the console's output, to be honest.) |
Could we reopen this until dealt with? |
Since my last message, I have found this problem two more times, as far as I can remember. This is what
|
OK, so looking at this last log, you have what looks like a successful app update:
and then, 6 minutes later, we see the server stopping:
So it looks like the problem is that there was a change that cause dev mode to exit. Since dev mode registers a ShutdownHook which stops the server upon exit, this stopped the server as well. So the root cause would seem to be the problem that "crashed" dev mode. Because of this I'm going to transfer back to the liberty-maven-plugin repo. (Sorry for the back-and-forth here). |
So @inad9300 it looks like the server is stopping because dev mode has exited. I'm guessing it "crashed" because of some unexpected error/event that it couldn't handle. Can you confirm that dev mode too exits when this issue happens? Does this log message suggest anything to you?
Assuming the understanding so far is correct, we could probably see what is going on more running with debug output ( Will wait for your response to consider what the next step might be. |
Indeed, everything exits, and I have to rerun
It does, I should have mentioned – |
For example, when I save a file named I think the idea is to ensure that the old file contents are still available if the editor crashes while writing the new file contents but I wonder if having that short-lived |
OK, we're getting somewhere. Thanks for confirming. Looking at the issue history, we actually added a filter in the past for excluding file patterns from dev mode: It'd seem we could try updating this filter adding the Unfortunately I don't think this is configurable, but rather hard-coded. |
Actually I guess it's more complicated than my last comment, since this code is already ignoring files that end with |
@inad9300 what version of the liberty-maven-plugin have you been using? Apologies if you mentioned already but I'm not seeing it now. |
I don't think I did, sorry. It's 3.10.2. |
Hi @inad9300 still trying to think of how to make progress here, since I've been unable to recreate. I'm wondering what OS you're running on? As mentioned here, we have encountered problems on Linux with "devc" when using an editor (like 'vi') which does a delete and copy instead of updating the file in-place. I can't think of why this would be a problem in regular 'dev' mode, but I wonder, if it would be convenient, if it would be worth running with Besides that another thing we might be able to do is to trigger some sort of thread dump from the If it seems like it might be something you'd be willing to do I can try to come up with a suggestion. Hopefully you would be willing too to use an Open J9-based JDKs which I'm more familiar with for this sort of thing. |
Thanks for your persistence, despite how little there is to pull from. As an update, I experienced the problem again 2 or 3 times since my last message. Here are some more details about my setup, in case they help:
|
Thanks for the additional info. So if we were able to come up with a strategy using dump agents to collect say something like the Open J9 javadump, would you be willing/able to run with that JDK and share that publicly? (Or would you be able to open a support case with IBM and share privately?) |
Sorry for dodging your question earlier. Hmm... 🤔 No, I don't think so. We'll have to come up with an alternative way to debug this, sorry. |
OK, a couple more questions:
Thanks |
|
Hmm... you might try to run with If you do decide to try this, please remember to redirect the log to a different directory outside the current project, or else dev mode will watch and react to the log changes! E.g. something like |
I have been trying to use |
Thanks for the update. One doesn't see a lot of humor in Maven plugin issue comments, so I tip my hat 👏 for that 😃 . Yes, that's definitely a blunt instrument so not surprised it changes the timing and is hard to tolerate too often. Will keep this open and see if we can think of anything. |
Describe the bug
While using the
liberty:dev
Maven plugin, a source code change that triggered a restart lead to the server being stopped. Here are the last log lines:And the code involved:
Expected behavior
The dev server should resist exceptions thrown during destruction.
Diagnostic information:
The text was updated successfully, but these errors were encountered: