Uploaded image for project: 'Couchbase Lite'
  1. Couchbase Lite
  2. CBL-637

Java Console app doesn't exit

    XMLWordPrintable

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.7.0
    • Helium
    • Java
    • Security Level: Public
    • CBL Sprint 13, CBL Sprint 14, CBL Sprint 16
    • 8

    Description

      The console app that uses CBL Java needs to do System.exit(0) to exit the app. This is likely caused by un-shutdown work executors that we use internally.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          pasin Pasin Suriyentrakorn added a comment - - edited

          I couldn't think a better way beside adding an API such as CouchbaseLite.deinit() or .shutdown() to shutdown the executor service. I have thought that maybe we lazy creates the executor and shutdown the executor when there are no database opens. However, this doesn't seem to work well as :

          1. The executor could be used by non-database components such as C4Log. Maybe we need to list all of these and see if we can avoid using the global executor service or not.
          2. There is no requirement that the app needs to close the database when exits. Maybe this is required for Java if they want to close the app gracefully beside using System.exit().

          The problem about CouchbaseLite.shutdown() is that it cannot be called safety if some components are still using it.

          pasin Pasin Suriyentrakorn added a comment - - edited I couldn't think a better way beside adding an API such as CouchbaseLite.deinit() or .shutdown() to shutdown the executor service. I have thought that maybe we lazy creates the executor and shutdown the executor when there are no database opens. However, this doesn't seem to work well as : The executor could be used by non-database components such as C4Log. Maybe we need to list all of these and see if we can avoid using the global executor service or not. There is no requirement that the app needs to close the database when exits. Maybe this is required for Java if they want to close the app gracefully beside using System.exit(). The problem about CouchbaseLite.shutdown() is that it cannot be called safety if some components are still using it.

          People

            The Lite The Lite
            pasin Pasin Suriyentrakorn
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty