Uploaded image for project: 'Couchbase .NET client library'
  1. Couchbase .NET client library
  2. NCBC-572

When using TimeSpan objects doesn't expiry from couchbase

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Major
    • 1.3.9
    • 1.3.7
    • library
    • None

    Description

      In version 1.3.6 here was a bug introduced when using Store method:
      http://www.couchbase.com/communities/q-and-a/store-memcached-bucket-expi...

      I upgraded to version 1.3.7 and it looks like this issue is still happening.

      When I pass TimeStamp to Store method they don't expire at all.

      our implementation:
      public void Store(StoreMode mode, string key, object value, TimeSpan validFor)

      { tryExecuteStore(() => _client.ExecuteStore(mode, key, getObjectToStore(value), validFor)); }

      private static void tryExecuteStore(Func<IOperationResult> executeStoreTask)

      { tryExecuteAndConvertExceptions(executeStoreTask, "Store"); }

      private static void tryExecuteAndConvertExceptions(Func<IOperationResult> executeStoreTask, string logName)
      {
      IOperationResult result = null;
      try

      { result = executeStoreTask(); }

      catch (Exception exception)

      { logUnsuccessfulOperationAndThrow(logName, exception.Message, exception); }

      if (!result.Success)
      logUnsuccessfulOperationAndThrow(logName, result.Message, result.Exception, result.StatusCode);
      }

      private static void logUnsuccessfulOperationAndThrow(
      string operationType, string message, Exception exception, int? statusCode = null)
      {
      message = String.Format("Error during

      {0} operation: {1}", operationType, message);
      if (statusCode.HasValue)
      message = String.Format("{0}

      (

      {1}

      -

      {2}

      )", message, statusCode.Value,
      ((CouchbaseStatusCode) statusCode.Value).ToString());

      _logger.Error(message, exception);
      throw new CouchbaseException(message, exception,
      statusCode == null ? default(CouchbaseStatusCode?) : (CouchbaseStatusCode) statusCode);
      }

      Attachments

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

        Activity

          People

            jmorris Jeff Morris
            agnieszkac Agnieszka Cieslak
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty