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
[proxy] Use ProxyServlet instead of AsyncProxyServlet #3022
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*Motivation* java.lang.IllegalStateException is thrown sometime when pulsar-admin connects through a pulsar proxy. ``` 06:10:42.202 [pulsar-external-web-60] WARN org.eclipse.jetty.io.SelectorManager - Exception while notifying connection HttpConnectionOverHTTP@3781919f::SocketChannelEndPoint@3946791f{prod-broker-2.prod-broker.default.svc.cluster.local/192.168.228.141:8080<->/192.168.122.159:41496,OPEN,fill=FI,flush=-,to=1/30000}{io=1/1,kio=1,kro=8}->HttpConnectionOverHTTP@3781919f(l:/192.168.122.159:41496 <-> r:prod-broker-2.prod-broker.default.svc.cluster.local/192.168.228.141:8080,closed=false)=>HttpChannelOverHTTP@3d79faef(exchange=HttpExchange@787b7324 req=PENDING/null@null res=PENDING/null@null)[send=HttpSenderOverHTTP@43cd18dd(req=BEGIN,snd=SENDING,failure=null)[HttpGenerator@49490f3a{s=START}],recv=HttpReceiverOverHTTP@3b153a7e(rsp=IDLE,failure=null)[HttpParser{s=START,0 of -1}]] java.lang.IllegalStateException: The same org.eclipse.jetty.client.AsyncContentProvider instance cannot be used in multiple requests at org.eclipse.jetty.client.util.DeferredContentProvider.setListener(DeferredContentProvider.java:117) ~[org.eclipse.jetty-jetty-client-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.client.HttpSender.send(HttpSender.java:207) ~[org.eclipse.jetty-jetty-client-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.client.http.HttpChannelOverHTTP.send(HttpChannelOverHTTP.java:85) ~[org.eclipse.jetty-jetty-client-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.client.HttpChannel.send(HttpChannel.java:128) ~[org.eclipse.jetty-jetty-client-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.client.HttpConnection.send(HttpConnection.java:201) ~[org.eclipse.jetty-jetty-client-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.client.http.HttpConnectionOverHTTP$Delegate.send(HttpConnectionOverHTTP.java:253) ~[org.eclipse.jetty-jetty-client-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.send(HttpConnectionOverHTTP.java:122) ~[org.eclipse.jetty-jetty-client-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.client.http.HttpDestinationOverHTTP.send(HttpDestinationOverHTTP.java:38) ~[org.eclipse.jetty-jetty-client-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.client.HttpDestination.process(HttpDestination.java:347) ~[org.eclipse.jetty-jetty-client-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.client.HttpDestination.process(HttpDestination.java:305) ~[org.eclipse.jetty-jetty-client-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.client.HttpDestination.send(HttpDestination.java:295) ~[org.eclipse.jetty-jetty-client-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.client.HttpDestination.succeeded(HttpDestination.java:229) ~[org.eclipse.jetty-jetty-client-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.client.AbstractConnectionPool.proceed(AbstractConnectionPool.java:154) ~[org.eclipse.jetty-jetty-client-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.client.AbstractConnectionPool$1.succeeded(AbstractConnectionPool.java:132) ~[org.eclipse.jetty-jetty-client-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.client.AbstractConnectionPool$1.succeeded(AbstractConnectionPool.java:124) ~[org.eclipse.jetty-jetty-client-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.util.Promise$Wrapper.succeeded(Promise.java:130) ~[org.eclipse.jetty-jetty-util-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.onOpen(HttpConnectionOverHTTP.java:130) ~[org.eclipse.jetty-jetty-client-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.io.SelectorManager.connectionOpened(SelectorManager.java:324) [org.eclipse.jetty-jetty-io-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.io.ManagedSelector.createEndPoint(ManagedSelector.java:254) [org.eclipse.jetty-jetty-io-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.io.ManagedSelector.access$1800(ManagedSelector.java:61) [org.eclipse.jetty-jetty-io-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.io.ManagedSelector$CreateEndPoint.run(ManagedSelector.java:886) [org.eclipse.jetty-jetty-io-9.4.12.v20180830.jar:9.4.12.v20180830] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_181] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_181] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181] ``` The race condition happens somewhere in setting listener. However I have no idea how the race condition happens. so change to use ProxyServlet to avoid this race condition. *Changes* Change AsyncProxyServlet to ProxyServlet
jiazhai
approved these changes
Nov 20, 2018
merlimat
approved these changes
Nov 20, 2018
massakam
approved these changes
Nov 20, 2018
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.
LGTM
merlimat
pushed a commit
that referenced
this pull request
Dec 13, 2018
*Motivation* java.lang.IllegalStateException is thrown sometime when pulsar-admin connects through a pulsar proxy. ``` 06:10:42.202 [pulsar-external-web-60] WARN org.eclipse.jetty.io.SelectorManager - Exception while notifying connection HttpConnectionOverHTTP@3781919f::SocketChannelEndPoint@3946791f{prod-broker-2.prod-broker.default.svc.cluster.local/192.168.228.141:8080<->/192.168.122.159:41496,OPEN,fill=FI,flush=-,to=1/30000}{io=1/1,kio=1,kro=8}->HttpConnectionOverHTTP@3781919f(l:/192.168.122.159:41496 <-> r:prod-broker-2.prod-broker.default.svc.cluster.local/192.168.228.141:8080,closed=false)=>HttpChannelOverHTTP@3d79faef(exchange=HttpExchange@787b7324 req=PENDING/null@null res=PENDING/null@null)[send=HttpSenderOverHTTP@43cd18dd(req=BEGIN,snd=SENDING,failure=null)[HttpGenerator@49490f3a{s=START}],recv=HttpReceiverOverHTTP@3b153a7e(rsp=IDLE,failure=null)[HttpParser{s=START,0 of -1}]] java.lang.IllegalStateException: The same org.eclipse.jetty.client.AsyncContentProvider instance cannot be used in multiple requests at org.eclipse.jetty.client.util.DeferredContentProvider.setListener(DeferredContentProvider.java:117) ~[org.eclipse.jetty-jetty-client-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.client.HttpSender.send(HttpSender.java:207) ~[org.eclipse.jetty-jetty-client-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.client.http.HttpChannelOverHTTP.send(HttpChannelOverHTTP.java:85) ~[org.eclipse.jetty-jetty-client-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.client.HttpChannel.send(HttpChannel.java:128) ~[org.eclipse.jetty-jetty-client-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.client.HttpConnection.send(HttpConnection.java:201) ~[org.eclipse.jetty-jetty-client-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.client.http.HttpConnectionOverHTTP$Delegate.send(HttpConnectionOverHTTP.java:253) ~[org.eclipse.jetty-jetty-client-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.send(HttpConnectionOverHTTP.java:122) ~[org.eclipse.jetty-jetty-client-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.client.http.HttpDestinationOverHTTP.send(HttpDestinationOverHTTP.java:38) ~[org.eclipse.jetty-jetty-client-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.client.HttpDestination.process(HttpDestination.java:347) ~[org.eclipse.jetty-jetty-client-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.client.HttpDestination.process(HttpDestination.java:305) ~[org.eclipse.jetty-jetty-client-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.client.HttpDestination.send(HttpDestination.java:295) ~[org.eclipse.jetty-jetty-client-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.client.HttpDestination.succeeded(HttpDestination.java:229) ~[org.eclipse.jetty-jetty-client-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.client.AbstractConnectionPool.proceed(AbstractConnectionPool.java:154) ~[org.eclipse.jetty-jetty-client-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.client.AbstractConnectionPool$1.succeeded(AbstractConnectionPool.java:132) ~[org.eclipse.jetty-jetty-client-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.client.AbstractConnectionPool$1.succeeded(AbstractConnectionPool.java:124) ~[org.eclipse.jetty-jetty-client-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.util.Promise$Wrapper.succeeded(Promise.java:130) ~[org.eclipse.jetty-jetty-util-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.onOpen(HttpConnectionOverHTTP.java:130) ~[org.eclipse.jetty-jetty-client-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.io.SelectorManager.connectionOpened(SelectorManager.java:324) [org.eclipse.jetty-jetty-io-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.io.ManagedSelector.createEndPoint(ManagedSelector.java:254) [org.eclipse.jetty-jetty-io-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.io.ManagedSelector.access$1800(ManagedSelector.java:61) [org.eclipse.jetty-jetty-io-9.4.12.v20180830.jar:9.4.12.v20180830] at org.eclipse.jetty.io.ManagedSelector$CreateEndPoint.run(ManagedSelector.java:886) [org.eclipse.jetty-jetty-io-9.4.12.v20180830.jar:9.4.12.v20180830] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_181] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_181] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181] ``` The race condition happens somewhere in setting listener. However I have no idea how the race condition happens. so change to use ProxyServlet to avoid this race condition. *Changes* Change AsyncProxyServlet to ProxyServlet
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
java.lang.IllegalStateException is thrown sometime when pulsar-admin connects through a pulsar proxy.
The race condition happens somewhere in setting listener. However I have no idea how the race condition
happens. so change to use ProxyServlet to avoid this race condition.
Changes
Change AsyncProxyServlet to ProxyServlet