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

Default to recoverable error on WebSocket Failure



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


      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…


        Issue Links

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



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



                Gerrit Reviews

                  There are no open Gerrit changes