Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-61039

Eventing: Better handle n1ql_timeout, analytics_timeout values that spill int32 boundary

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • Morpheus
    • 7.6.0, 7.6.2
    • eventing
    • None
    • Untriaged
    • 0
    • Unknown

    Description

      We set n1ql_timeout / analytics_timeout based on execution_timeout as:

         data_.n1ql_timeout =
             static_cast<lcb_U32>(h_config->execution_timeout < 3
                                      ? 500000
                                      : (h_config->execution_timeout - 2) * 1000000);
      

      If h_config->execution_timeout is high enough the result of the following expression goes beyond the uint32 limit:

      (h_config->execution_timeout - 2) * 1000000
      

      uint32 limits to 4,294,967,295 which in seconds is 4294 seconds (~71 minutes which is 1 hour 11 minutes).

      If the timeout value is more than this number, let's say: 120 minutes (7,200,000,000 microseconds) this wraps the timeout value around numeric_limits(uint32) which now becomes: 2905 seconds (48 minutes).

      This unambiguous behaviour should be addressed, in a way that the timeout should be capped to the limit of uint32 instead of wrapping the timeout around.

      Attachments

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

        Activity

          People

            abhishek.jindal Abhishek Jindal
            abhishek.jindal Abhishek Jindal
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty