Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.0-dp4
    • Fix Version/s: 1.1.0
    • Component/s: library
    • Security Level: Public
    • Labels:
      None

      Description

      When you connect via the new Couchbase(...) is not a direct way to check for whether the connection failed.

      It is not possible to check getResultCode()/getResultMessage() since this provides a unintilized couchbase

        Issue Links

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

          Activity

          akadna Dan Andersen created issue -
          Hide
          mnunberg Mark Nunberg added a comment -

          For this we'd probably need to change the ext code to return a valid couchbase object so that getResultCode can be called on it (to check for connection failures).

          For the non-oo variant (couchbase_connect) behavior should remain the same

          Additionally, all the code which now checks for the couchbase object to simply exist should be changed to check that the couchbase object is indeed connected (I believe lcb has a function for that, but if not we can set our own little flag in our php_couchbase_ctx structure).

          One workaround is to call set_error_handler and make it throw an ErrorException right before instantiation. Then the connection can be done in a try/catch block, with any message being found in $ex->getMessage().

          I believe there may be ther workarounds as well

          Show
          mnunberg Mark Nunberg added a comment - For this we'd probably need to change the ext code to return a valid couchbase object so that getResultCode can be called on it (to check for connection failures). For the non-oo variant (couchbase_connect) behavior should remain the same Additionally, all the code which now checks for the couchbase object to simply exist should be changed to check that the couchbase object is indeed connected (I believe lcb has a function for that, but if not we can set our own little flag in our php_couchbase_ctx structure). One workaround is to call set_error_handler and make it throw an ErrorException right before instantiation. Then the connection can be done in a try/catch block, with any message being found in $ex->getMessage(). I believe there may be ther workarounds as well
          mnunberg Mark Nunberg made changes -
          Field Original Value New Value
          Assignee Matt Ingenthron [ ingenthr ] Michael Jackson [ mjackson ]
          Affects Version/s 1.0.5 [ 10339 ]
          mjackson Michael Jackson made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Hide
          mjackson Michael Jackson added a comment -
          Show
          mjackson Michael Jackson added a comment - patch set in progress: http://review.couchbase.org/#/c/21433/
          Hide
          mjackson Michael Jackson added a comment -

          As a side note, I have a 1.0.x backport of the changes above ready to roll once the master branch changes are approved/merged.

          Show
          mjackson Michael Jackson added a comment - As a side note, I have a 1.0.x backport of the changes above ready to roll once the master branch changes are approved/merged.
          Hide
          mjackson Michael Jackson added a comment -

          master branch changeset is merged in. 1.0.x changeset is here: http://review.couchbase.org/#/c/21487/

          Show
          mjackson Michael Jackson added a comment - master branch changeset is merged in. 1.0.x changeset is here: http://review.couchbase.org/#/c/21487/
          mjackson Michael Jackson made changes -
          Status In Progress [ 3 ] Open [ 1 ]
          Hide
          mjackson Michael Jackson added a comment -

          (I believe all this needs for resolution is the 1.0.x changeset mentioned above to be merged into 1.0.x branch.)

          Show
          mjackson Michael Jackson added a comment - (I believe all this needs for resolution is the 1.0.x changeset mentioned above to be merged into 1.0.x branch.)
          Hide
          mjackson Michael Jackson added a comment -

          1.0.x merged in just now, 1.1 has been in for a bit. Should be present in next released versions.

          Show
          mjackson Michael Jackson added a comment - 1.0.x merged in just now, 1.1 has been in for a bit. Should be present in next released versions.
          mjackson Michael Jackson made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 1.0.6 [ 10368 ]
          Fix Version/s 1.1.0-dp6 [ 10402 ]
          Resolution Fixed [ 1 ]
          ingenthr Matt Ingenthron made changes -
          Fix Version/s 1.1.0 [ 10242 ]
          Fix Version/s 1.1.0-dp6 [ 10402 ]
          mnunberg Mark Nunberg made changes -
          Link This issue duplicates PCBC-58 [ PCBC-58 ]
          trond Trond Norbye made changes -
          Fix Version/s 1.0.6 [ 10368 ]
          trond Trond Norbye made changes -
          Affects Version/s 1.0.5 [ 10339 ]
          brett19 Brett Lawson made changes -
          Workflow jira [ 21130 ] Couchbase SDK Workflow [ 44344 ]

            People

            • Assignee:
              mjackson Michael Jackson
              Reporter:
              akadna Dan Andersen
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes