Skip to content

Commit 19ed22e

Browse files
committed
Add more no_ice cutout points.
1 parent f527cfc commit 19ed22e

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/main/java/water/H2O.java

+13
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,11 @@ public static void main( String[] args ) {
920920
Log.info("Opted out of sending usage metrics.");
921921
}
922922

923+
if (OPT_ARGS.no_ice) {
924+
// Cleaner callback happens in a different classloader. Do this so they can share the state info.
925+
System.setProperty("h2o.args.no_ice", "true");
926+
}
927+
923928
if (OPT_ARGS.baseport != 0) {
924929
DEFAULT_PORT = OPT_ARGS.baseport;
925930
}
@@ -1612,11 +1617,19 @@ static boolean lazyPersist(){ // free disk > our DRAM?
16121617
return !H2O.OPT_ARGS.no_ice && H2O.SELF._heartbeat.get_free_disk() > MemoryManager.MEM_MAX;
16131618
}
16141619
static boolean isDiskFull(){ // free disk space < 5K?
1620+
if (H2O.OPT_ARGS.no_ice) {
1621+
return true;
1622+
}
1623+
16151624
long space = Persist.getIce().getUsableSpace();
16161625
return space != Persist.UNKNOWN && space < (5 << 10);
16171626
}
16181627

16191628
@Override public void run() {
1629+
if (H2O.OPT_ARGS.no_ice) {
1630+
return;
1631+
}
1632+
16201633
boolean diskFull = false;
16211634
while( true ) {
16221635
// Sweep the K/V store, writing out Values (cleaning) and free'ing

src/main/java/water/MemoryManager.java

+4
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,10 @@ private static class HeapUsageMonitor implements javax.management.NotificationLi
200200
* Limit to touching global vars in the Boot class.
201201
*/
202202
public void handleNotification(Notification notification, Object handback) {
203+
if (System.getProperty("h2o.args.no_ice") != null) {
204+
return;
205+
}
206+
203207
String notifType = notification.getType();
204208
if( notifType.equals(MemoryNotificationInfo.MEMORY_COLLECTION_THRESHOLD_EXCEEDED)) {
205209
// Memory used after this FullGC

0 commit comments

Comments
 (0)