MCPcopy Create free account
hub / github.com/apache/solr / closeAndWait

Method closeAndWait

solr/core/src/java/org/apache/solr/core/SolrCore.java:1580–1603  ·  view source on GitHub ↗

Close the core, if it is still in use waits until is no longer in use. @see #close() @see #isClosed()

()

Source from the content-addressed store, hash-verified

1578 }
1579 }
1580
1581 /**
1582 * Close the core, if it is still in use waits until is no longer in use.
1583 *
1584 * @see #close()
1585 * @see #isClosed()
1586 */
1587 public void closeAndWait() {
1588 close();
1589 while (!isClosed()) {
1590 final long milliSleep = 100;
1591 if (log.isInfoEnabled()) {
1592 log.info(
1593 "Core {} is not yet closed, waiting {} ms before checking again.",
1594 getName(),
1595 milliSleep);
1596 }
1597 try {
1598 Thread.sleep(milliSleep);
1599 } catch (InterruptedException e) {
1600 Thread.currentThread().interrupt();
1601 throw new SolrException(
1602 ErrorCode.SERVER_ERROR,
1603 "Caught InterruptedException whilst waiting for core "
1604 + getName()
1605 + " to close: "
1606 + e.getMessage(),

Callers 1

unloadWithoutCoreOpMethod · 0.95

Calls 6

closeMethod · 0.95
isClosedMethod · 0.95
getNameMethod · 0.95
infoMethod · 0.45
sleepMethod · 0.45
getMessageMethod · 0.45

Tested by

no test coverage detected