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

Random.Next eventually only returns zero

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 3.2.7
    • 3.2.5
    • library
    • None
    • 1

    Description

      See https://stackoverflow.com/questions/4613693/random-next-sometimes-returns-same-number-in-separate-threads and https://csharpindepth.com/Articles/Random

      The solution is to either switch to a round-robin mechanism or develop a thread-safe randomizer. Another possible solution that I am not to fond of is to detect that zero is being returned consecutively and re-instantiate the random instance.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              PagerDuty