@Test
  public void testRollingDeadlockSituation() {
    final int MAX_OPLOG_SIZE = 2000;
    diskProps.setMaxOplogSize(MAX_OPLOG_SIZE);
    diskProps.setPersistBackup(true);
    diskProps.setRolling(true);
    diskProps.setSynchronous(true);
    diskProps.setOverflow(false);
    diskProps.setDiskDirsAndSizes(new File[] {dirs[0]}, new int[] {1400});
    final byte[] val = new byte[500];
    proceed = false;
    region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, diskProps, Scope.LOCAL);
    region.put("key1", val);
    region.put("key1", val);
    try {
      region.put("key1", val);
    } catch (DiskAccessException dae) {
      logWriter.error("Exception occurred", dae);
      fail(
          "Test failed as DiskAccessException was encountered where as the operation should ideally have proceeded without issue . exception = "
              + dae);
    }
  }
tests a potential deadlock situation if the operation causing a swithcing of Oplog is waiting
for roller to free space. The problem can arise if the operation causing Oplog switching is
going on an Entry , which already has its oplog ID referring to the Oplog being switched. In
such case, when the roller will try to roll the entries referencing the current oplog , it will
not be able to acquire the lock on the entry as the switching thread has already taken a lock
on it.
geode-core/src/integrationTest/java/org/apache/geode/internal/cache/OplogJUnitTest.java