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

Default to recoverable error on WebSocket Failure

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Won't Fix
    • Major
    • None
    • None
    • Java, Java-Android
    • Security Level: Public
    • None
    • 1

    Description

      The problem with the Java socket handling code is that whatever error codes the OS sees get translated into platform agnostic Java Exception. Since Java handles the connection, (kC4NoFraming) Core expects it to report an actual POSIX error code. That means that the error handling code has to undo what Java just did. That's essentially impossible, since Java lost information in the process (Note that this is not so bad in Android, where there is an ErrnoException that includes the Linux error number).
      The general strategy of the code is to look at an exception and kind of heuristically make its best guess which POSIX code corresponds. Currently, if the code cannot identify the exception, it claims that the error is an (unrecoverable) PolicyError.

      The last several bugs I’ve gotten have all wanted me to loosen restrictions and to treat one more kind of exception as recoverable.

      Instead of updating the code as we encounter these retryable circumstances, one by one time, we should change the error handling code so that any time it cannot otherwise classify an exception it will tell LiteCore that the failure is domain 6 (web socket) code 4001 (user transient)

      That’s retryable…

      Attachments

        Issue Links

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

          Activity

            People

              The Lite The Lite
              blake.meike Blake Meike
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty