Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-4651

LevelDB crashes JVM when stop() is called concurrently with write()

    Details

      Description

      This test reproduces the issue:

          public void testConcurrentWriteAndRestart() {
            final int THREADS = 4;
            final AtomicBoolean run = new AtomicBoolean(true);
            final CountDownLatch started = new CountDownLatch(THREADS);
            ExecutorService executor = Executors.newFixedThreadPool(THREADS);
            for (int i = 0; i < THREADS; ++i) {
               executor.execute(new Runnable() {
                  @Override
                  public void run() {
                     started.countDown();
                     int i = 0;
                     while (run.get()) {
                        InternalCacheEntry entry = TestInternalCacheEntryFactory.create("k" + i, "v" + i);
                        MarshalledEntry me = TestingUtil.marshalledEntry(entry, getMarshaller());
                        cl.write(me);
                        ++i;
                     }
                  }
               });
            }
            try {
               started.await();
               Thread.sleep(1000);
               cl.stop();
               Thread.sleep(1000);
               cl.start();
               Thread.sleep(1000);
            } catch (InterruptedException e) {
               throw new IllegalStateException(e);
            } finally {
               run.set(false);
               executor.shutdown();
            }
         }
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                rvansa Radim Vansa
                Reporter:
                rvansa Radim Vansa
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: