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

mapreduce nif terminator loop is using CPU time _of all process' threads_ as a clock causing 5 seconds to elapse _much_ earlier than wall clock 5 seconds under load

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.1.0
    • Component/s: view-engine
    • Security Level: Public
    • Labels:
      None
    • Environment:
      Linux, but seemingly any POSIX and perhaps even windows

      Description

      clock(3) is using process CPU time. Which is kinda nice except that it'll be sum of CPU times of all threads. If we have 8-16 or more cores that time will advance 8-16 or more times faster than wall clock time. Thus termination timeout will occur much earlier than 5 seconds. Seemingly.

      # Subject Project Status CR V
      For Gerrit Dashboard: &For+MB-7453=message:MB-7453

        Activity

        Hide
        FilipeManana Filipe Manana (Inactive) added a comment -

        And why exactly is this is such a critical problem?
        I haven't seen this in practice to be significantly shorter than 5 seconds or taking any significant amount of CPU time.

        Show
        FilipeManana Filipe Manana (Inactive) added a comment - And why exactly is this is such a critical problem? I haven't seen this in practice to be significantly shorter than 5 seconds or taking any significant amount of CPU time.
        Hide
        alkondratenko Aleksey Kondratenko (Inactive) added a comment -

        You used clock to rely on ansi C api for easiler portability? Using just wall clock time looks like much righter option and windows implementation of gettimeofday can be stolen from ep-engine.

        Show
        alkondratenko Aleksey Kondratenko (Inactive) added a comment - You used clock to rely on ansi C api for easiler portability? Using just wall clock time looks like much righter option and windows implementation of gettimeofday can be stolen from ep-engine.
        Hide
        thuan Thuan Nguyen added a comment -

        Integrated in github-couchdb-preview #547 (See http://qa.hq.northscale.net/job/github-couchdb-preview/547/)
        MB-7453: use time() for long running mapreduce task termination (Revision e91444dc088ea984ed2541284f8fe1c9bc735446)

        Result = SUCCESS
        Filipe David Borba Manana :
        Files :

        • src/mapreduce/mapreduce.h
        • src/mapreduce/mapreduce.cc
        • src/mapreduce/mapreduce_nif.cc
        Show
        thuan Thuan Nguyen added a comment - Integrated in github-couchdb-preview #547 (See http://qa.hq.northscale.net/job/github-couchdb-preview/547/ ) MB-7453 : use time() for long running mapreduce task termination (Revision e91444dc088ea984ed2541284f8fe1c9bc735446) Result = SUCCESS Filipe David Borba Manana : Files : src/mapreduce/mapreduce.h src/mapreduce/mapreduce.cc src/mapreduce/mapreduce_nif.cc
        Hide
        thuan Thuan Nguyen added a comment -

        Integrated in github-couchdb-preview #567 (See http://qa.hq.northscale.net/job/github-couchdb-preview/567/)
        MB-7453: use time() for long running mapreduce task termination (Revision 8a3a3591208c3b02b91aa991ede989a13e0223d7)

        Result = SUCCESS
        Filipe David Borba Manana :
        Files :

        • src/mapreduce/mapreduce.cc
        • src/mapreduce/mapreduce.h
        • src/mapreduce/mapreduce_nif.cc
        Show
        thuan Thuan Nguyen added a comment - Integrated in github-couchdb-preview #567 (See http://qa.hq.northscale.net/job/github-couchdb-preview/567/ ) MB-7453 : use time() for long running mapreduce task termination (Revision 8a3a3591208c3b02b91aa991ede989a13e0223d7) Result = SUCCESS Filipe David Borba Manana : Files : src/mapreduce/mapreduce.cc src/mapreduce/mapreduce.h src/mapreduce/mapreduce_nif.cc
        Hide
        maria Maria McDuff (Inactive) added a comment -

        andrei, pls verify (then close if passes) in current 2.0.2 build. thanks.

        Show
        maria Maria McDuff (Inactive) added a comment - andrei, pls verify (then close if passes) in current 2.0.2 build. thanks.
        Hide
        maria Maria McDuff (Inactive) added a comment -

        not qe verifiable.

        Show
        maria Maria McDuff (Inactive) added a comment - not qe verifiable.

          People

          • Assignee:
            andreibaranouski Andrei Baranouski
            Reporter:
            alkondratenko Aleksey Kondratenko (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes