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

Remove unnecessary linked CancellationToken

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.1.1
    • None
    • None
    • 1

    Description

      1.

      CouchbaseCollection.RetryUntilTimeoutOrSuccessAsync

      should dispose the cancellation token source

      2.

      RetryOrchestrator.RetryAsync should dispose 

      tokensource created by
      if (request.Timeout > TimeSpan.Zero)

      { var cts = CancellationTokenSource.CreateLinkedTokenSource(token, new CancellationTokenSource(request.Timeout).Token); token = cts.Token; }

      3. RetryOrchestrator.RetryAsync unnecessarily creates linked source

      await Task.Delay(cappedDuration,
      CancellationTokenSource.CreateLinkedTokenSource(token).Token).ConfigureAwait(false);

       

       

       

      Attachments

        Issue Links

          For Gerrit Dashboard: NCBC-2694
          # Subject Branch Project Status CR V

          Activity

            jmorris Jeff Morris added a comment -

            Tommy Jakobsen -

            I am pretty sure this is covered by NCBC-2734, if not feel free to explain and i'll reopen.

            Thanks,

            Jeff

            jmorris Jeff Morris added a comment - Tommy Jakobsen - I am pretty sure this is covered by NCBC-2734 , if not feel free to explain and i'll reopen. Thanks, Jeff

            Case 1 and 2 is resolved, case 3 is still there:

            await Task.Delay(cappedDuration,
            CancellationTokenSource.CreateLinkedTokenSource(token).Token).ConfigureAwait(false);

            can be changed to 

            await Task.Delay(cappedDuration, token).ConfigureAwait(false);

            tommyja Tommy Jakobsen added a comment - Case 1 and 2 is resolved, case 3 is still there: await Task.Delay(cappedDuration, CancellationTokenSource.CreateLinkedTokenSource(token).Token).ConfigureAwait(false); can be changed to  await Task.Delay(cappedDuration, token).ConfigureAwait(false);

            People

              jmorris Jeff Morris
              tommyja Tommy Jakobsen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty