-
Notifications
You must be signed in to change notification settings - Fork 22
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
1741 : solr auto exec complete #2582
base: develop
Are you sure you want to change the base?
Conversation
# Conflicts: # shanoir-ng-datasets/src/main/java/org/shanoir/ng/solr/service/SolrServiceImpl.java # Conflicts: # shanoir-ng-datasets/src/main/java/org/shanoir/ng/solr/service/SolrServiceImpl.java
Hi @a-ba, I hope you are doing fine. |
while (Objects.isNull(solrClient) && (System.currentTimeMillis() - startTime) < MAX_WAIT_TIME_MS) { | ||
try { | ||
solrClient = new HttpSolrClient.Builder(solrUrl).build(); | ||
} catch (Exception ignored) { |
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.
Please do not ignore silently all errors. Only « connection refused errors » should be caught here. Other errors should be reported immediately.
@Value("${spring.data.solr.host}") | ||
private String solrUrl; | ||
|
||
private static final int RETRY_INTERVAL_MS = 5000; |
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.
5s is too much for may taste (it may happen on ordinary startup because there is a race condition, and i prefer the service to boot as fast as possible).
1 second would be sufficent, this won't overload the server (or if you fancy exponential backoff, you can set a 0.5s initial retry timeout, with a backoff factor of 1.5, i.e: interval = inverval * 1.5
inside the loop).
Not tested in remote
If #2581 is already merged, SorlServiceImpl.indexAllNoAuth() have to be replaced by this (done) :