[ 
https://issues.apache.org/jira/browse/SOLR-13871?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16963337#comment-16963337
 ] 

Chris M. Hostetter commented on SOLR-13871:
-------------------------------------------

bq.  ...then that replica is essentially gone,...

well, that's the crux of the concern i mentioned about assumptions in SolrCloud 
code.

Once upon a time i thought the point of  'genericCoreNodeNames' was to to make 
it possible for you shutdown a node, and start it up on a completely new 
host/port and those replicas would be recognized exactly the same as they were 
before, w/o any problems, regardless of what the old port was ... but i think i 
asked about this a while back and people who know more then me about SolrCloud 
and routing and replica status said "no, it's not that smart"

My goal here is that *IF* we _can_ easily make SolrCloud that smart -- in a new 
jira that would block this one -- then we can/should fix JettySolrRunner to 
stop jumping through it's current hoops on restart, just pick a new random 
port, and let SolrCloud figure out that those old replicas have come back on a 
new port -- and then fix any test code that breaks when we do that (ie: keeping 
an HttpSolrClient around even after the jetty has been restarted)

If we *CAN'T* easily fix SolrCloud do that, then we should consider other test 
workarounds (like doing proxy port blocking where possible) to eliminate as 
much as possible the *need* to make JettySolrRunner try to forcibly re-use the 
same port as much as possible.

(Another "workaround" i've considered, but haven't had a chance to look into 
yet, is to catch the BindException in tests where we know we've tried to 
"restart" a jetty port, and instead throw an AssumptionFailedException -- so at 
least we get a SKIP instead of a missleading FAIL when the problem is just that 
the test couldn't get the port it needs from the OS.

> JettySolrRunner should stop trying to re-use ports on re-start
> --------------------------------------------------------------
>
>                 Key: SOLR-13871
>                 URL: https://issues.apache.org/jira/browse/SOLR-13871
>             Project: Solr
>          Issue Type: Sub-task
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Chris M. Hostetter
>            Priority: Major
>
> JettySolrRunner currently has special logic in it's {{start()}} method that 
> will cause it (by default) to try to rebind to the port it was previously 
> assigned if it's restarting and configured with port '0'
> ie: the first time it starts the OS assigns the port, after that it tries to 
> re-use that same port.
> This is a bad idea in general, and leads to (very slow) BindException 
> failures in a lot of jenkins tests where nodes are restarted.
> Example...
> {noformat}
>    [junit4]   2> NOTE: reproduce with: ant test  -Dtestcase=ShardSplitTest 
> -Dtests.method=testSplitWithChaosMonkey -Dtests.seed=9097C20E8E9ACC68 -Dtes
> ts.multiplier=2 -Dtests.nightly=true -Dtests.slow=true 
> -Dtests.linedocsfile=/home/jenkins/jenkins-slave/workspace/Lucene-Solr-NightlyTests-master/test
> -data/enwiki.random.lines.txt -Dtests.locale=so-SO -Dtests.timezone=Etc/GMT+9 
> -Dtests.asserts=true -Dtests.file.encoding=UTF-8
>    [junit4] ERROR   81.2s J1 | ShardSplitTest.testSplitWithChaosMonkey <<<
>    [junit4]    > Throwable #1: java.net.BindException: Address already in use
>    [junit4]    >        at 
> __randomizedtesting.SeedInfo.seed([9097C20E8E9ACC68:1BB011DFCF9C67EC]:0)
>    [junit4]    >        at java.base/sun.nio.ch.Net.bind0(Native Method)
>    [junit4]    >        at java.base/sun.nio.ch.Net.bind(Net.java:461)
>    [junit4]    >        at java.base/sun.nio.ch.Net.bind(Net.java:453)
>    [junit4]    >        at 
> java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:227)
>    [junit4]    >        at 
> java.base/sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:80)
>    [junit4]    >        at 
> org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:342)
>    [junit4]    >        at 
> org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:308)
>    [junit4]    >        at 
> org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
>    [junit4]    >        at 
> org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:236)
>    [junit4]    >        at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>    [junit4]    >        at 
> org.eclipse.jetty.server.Server.doStart(Server.java:396)
>    [junit4]    >        at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>    [junit4]    >        at 
> org.apache.solr.client.solrj.embedded.JettySolrRunner.retryOnPortBindFailure(JettySolrRunner.java:569)
>    [junit4]    >        at 
> org.apache.solr.client.solrj.embedded.JettySolrRunner.start(JettySolrRunner.java:508)
>    [junit4]    >        at 
> org.apache.solr.client.solrj.embedded.JettySolrRunner.start(JettySolrRunner.java:476)
>    [junit4]    >        at 
> org.apache.solr.cloud.api.collections.ShardSplitTest.testSplitWithChaosMonkey(ShardSplitTest.java:499)
> {noformat}
> Ideally JettySolrRunner's default behavior should b to just trust it's config 
> – binding to a random port (even on restart, even if diff from it's previous 
> port) if configured with '0'.
> Callers – including tests – should eliminate any assumptions in their code 
> that the port will be consistent for the life of a JettySolrRunner (ie: 
> accept that the URL may change anytime stop/start is called)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to