Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,8 @@ else if (restored != null)
if (defrgMgr != null)
defrgMgr.cancel();

checkpointManager.stop(cancel);
if (checkpointManager != null)
checkpointManager.stop(cancel);

super.onKernalStop0(cancel);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.testframework.ListeningTestLogger;
import org.apache.ignite.testframework.LogListener;
import org.apache.ignite.testframework.junits.WithSystemProperty;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.junit.Test;
Expand Down Expand Up @@ -85,20 +86,30 @@ public void testPersistentConfiguration() throws Exception {
* Checks that an exception is thrown if WAL segment size is larger than max WAL archive size.
*/
@Test
public void testIncorrectMaxArchiveSizeConfiguration() throws Exception {
public void testIncorrectMaxArchiveSizeConfiguration() {
DataStorageConfiguration dataStorageConfiguration = new DataStorageConfiguration()
.setWalSegmentSize((int)U.MB)
.setMaxWalArchiveSize(10)
.setDefaultDataRegionConfiguration(
new DataRegionConfiguration().setPersistenceEnabled(true)
);

ListeningTestLogger listeningLog = new ListeningTestLogger();
LogListener npeChecker = LogListener.matches(NullPointerException.class.getName()).build();
listeningLog.registerListener(npeChecker);

assertThrowsAnyCause(
log,
() -> startGrid(0, (IgniteConfiguration cfg) -> cfg.setDataStorageConfiguration(dataStorageConfiguration)),
() -> startGrid(0, (IgniteConfiguration cfg) ->
cfg
.setDataStorageConfiguration(dataStorageConfiguration)
.setGridLogger(listeningLog)
),
IgniteCheckedException.class,
"maxWalArchiveSize must be no less than"
);

assertFalse(npeChecker.check());
}

/**
Expand Down
Loading