Skip to content
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

#2115 Unable to stop hop-server from command-line #2229

Merged
merged 2 commits into from
Feb 14, 2023

Conversation

uraychang
Copy link
Contributor

Please add a meaningful description for your change here


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Run mvn clean install apache-rat:check to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
  • If you have a group of commits related to the same change, please squash your commits into one and force push your branch using git rebase -i.
  • Mention the appropriate issue in your description (for example: addresses #123), if applicable.

To make clear that you license your contribution under the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

@hansva
Copy link
Contributor

hansva commented Feb 10, 2023

Seems to work as expected, thanks @uraychang ! I only have a couple of small remarks.

Remarks:

  • when executing ./hop-server.sh -k -u cluster -p cluster localhost 8079 we now get a stacktrace [1] I think we need to send a response before actually killing it something like "stopping server on port ...."
  • we provide a default hop-server.xml maybe we should add the option in there by default too assemblies/static/src/main/resources/hop-server.xml
  • Documentation needs an update
  • Docker documentation needs an update (exposing the port too)

[1]

eb 10, 2023 1:00:35 PM org.glassfish.jersey.message.internal.MessagingBinders$EnabledProvidersBinder bindToBinder
WARNING: A class javax.activation.DataSource for a default provider MessageBodyWriter<javax.activation.DataSource> was not found. The provider is not available.
org.apache.hop.www.HopServer$HopServerCommandException: "No Hop Server Server found at localhost:8079
	at org.apache.hop.www.HopServer.callStopHopServerRestService(HopServer.java:695)
	at org.apache.hop.www.HopServer.shutdown(HopServer.java:644)
	at org.apache.hop.www.HopServer.run(HopServer.java:278)
	at org.apache.hop.www.HopServer.main(HopServer.java:564)
Caused by: javax.ws.rs.ProcessingException: java.net.ConnectException: Connection refused
	at org.glassfish.jersey.client.internal.HttpUrlConnector.apply(HttpUrlConnector.java:268)
	at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:297)
	at org.glassfish.jersey.client.JerseyInvocation.lambda$invoke$1(JerseyInvocation.java:675)
	at org.glassfish.jersey.client.JerseyInvocation.call(JerseyInvocation.java:697)
	at org.glassfish.jersey.client.JerseyInvocation.lambda$runInScope$3(JerseyInvocation.java:691)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:205)
	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:390)
	at org.glassfish.jersey.client.JerseyInvocation.runInScope(JerseyInvocation.java:691)
	at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:674)
	at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:422)
	at org.glassfish.jersey.client.JerseyInvocation$Builder.get(JerseyInvocation.java:318)
	at org.apache.hop.www.HopServer.callStopHopServerRestService(HopServer.java:681)
	... 3 more
Caused by: java.net.ConnectException: Connection refused
	at java.base/sun.nio.ch.Net.connect0(Native Method)
	at java.base/sun.nio.ch.Net.connect(Net.java:579)
	at java.base/sun.nio.ch.Net.connect(Net.java:568)
	at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:576)
	at java.base/java.net.Socket.connect(Socket.java:666)
	at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:178)
	at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:531)
	at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:636)
	at java.base/sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:932)
	at java.base/sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:759)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1684)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1585)
	at java.base/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:529)
	at org.glassfish.jersey.client.internal.HttpUrlConnector._apply(HttpUrlConnector.java:377)
	at org.glassfish.jersey.client.internal.HttpUrlConnector.apply(HttpUrlConnector.java:266)
	... 16 more

@uraychang
Copy link
Contributor Author

Oh sorry I didn't notice the exception. Yes you're right. Will take a look and update them soon. Thanks @hansva

@uraychang
Copy link
Contributor Author

uraychang commented Feb 14, 2023

hi @hansva for your first remark, I didn't seem to get the error as yours.
if starting the server with a shutdown port (8086) like sh hop-server.sh localhost 8085 8086
we should shut down the server by sh hop-server.sh -k -u cluster -p cluster localhost 8085 8086

but if no shutdown port was specified like sh hop-server.sh localhost 8085
no need to give the shutdown port as well sh hop-server.sh -k -u cluster -p cluster localhost 8085 (default shutdown port is 8079)
because I saw you use ./hop-server.sh -k -u cluster -p cluster localhost 8079 not sure if you're confused by this

besides, how can I start the server with default hop-server.xml?

@hansva
Copy link
Contributor

hansva commented Feb 14, 2023

You are right, I was sending the -k request to the shutdown port without specifying the regular port.
This caused the exception. you can start the server with an xml using ./hop-server.sh hop-server.xml

@uraychang
Copy link
Contributor Author

Thanks for the update Hans. Sorry today's a bit busy. Not able to submit the changes.

@hansva
Copy link
Contributor

hansva commented Feb 14, 2023

No worries @uraychang! we are in this together! thanks for the hard work!

@hansva hansva merged commit 51c7eaa into apache:master Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants