incorporate feedback
Original commit: elastic/x-pack-elasticsearch@f10ea80143
This commit is contained in:
parent
7e3fac9b35
commit
57544b8688
|
@ -394,11 +394,7 @@ public class LicensesService extends AbstractLifecycleComponent implements Clust
|
|||
@Override
|
||||
protected void doStart() throws ElasticsearchException {
|
||||
clusterService.add(this);
|
||||
try {
|
||||
scheduler.start(Collections.emptyList());
|
||||
} catch (Exception e) {
|
||||
logger.warn("failed to start license trigger service", e);
|
||||
}
|
||||
scheduler.start(Collections.emptyList());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -433,16 +429,13 @@ public class LicensesService extends AbstractLifecycleComponent implements Clust
|
|||
logger.debug("current [{}]", currentLicensesMetaData);
|
||||
}
|
||||
// notify all interested plugins
|
||||
if (previousClusterState.blocks().hasGlobalBlock(GatewayService.STATE_NOT_RECOVERED_BLOCK)) {
|
||||
onUpdate(currentLicensesMetaData);
|
||||
} else {
|
||||
if (prevLicensesMetaData == null) {
|
||||
if (currentLicensesMetaData != null) {
|
||||
onUpdate(currentLicensesMetaData);
|
||||
}
|
||||
} else if (!prevLicensesMetaData.equals(currentLicensesMetaData)) {
|
||||
if (previousClusterState.blocks().hasGlobalBlock(GatewayService.STATE_NOT_RECOVERED_BLOCK)
|
||||
|| prevLicensesMetaData == null) {
|
||||
if (currentLicensesMetaData != null) {
|
||||
onUpdate(currentLicensesMetaData);
|
||||
}
|
||||
} else if (!prevLicensesMetaData.equals(currentLicensesMetaData)) {
|
||||
onUpdate(currentLicensesMetaData);
|
||||
}
|
||||
// auto-generate license if no licenses ever existed
|
||||
// this will trigger a subsequent cluster changed event
|
||||
|
|
|
@ -109,9 +109,7 @@ public class LicensesManagerServiceTests extends ESSingleNodeTestCase {
|
|||
|
||||
// ensure that the invalid license never made it to cluster state
|
||||
LicensesMetaData licensesMetaData = clusterService.state().metaData().custom(LicensesMetaData.TYPE);
|
||||
if (licensesMetaData != null) {
|
||||
assertThat(licensesMetaData.getLicense(), not(equalTo(tamperedLicense)));
|
||||
}
|
||||
assertThat(licensesMetaData.getLicense(), not(equalTo(tamperedLicense)));
|
||||
}
|
||||
|
||||
public void testRemoveLicenses() throws Exception {
|
||||
|
|
Loading…
Reference in New Issue