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

mapreduce long running task termination is sometimes inneffective

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.1.0
    • Component/s: 3rd-party, view-engine
    • Security Level: Public
    • Labels:
      None
    • Environment:
      Linux with SMP

      Description

      I've noticed that mapreduce tests take huge amount of time to run on my box.

      Investigation showed that it's caused by unfairness of mutexes which v8 is using for it's isolate Locker. I.e. I've seen that:

      a) terminateTask locker constructor gets stuck for minutes (confirmed by looking at threads' backtraces in gdb)
      b) v8 isolate preemption 'works'. There's periodic sched_yield invocations, but seemingly they are not effective as sched_yield is effectively a noop especially if another thread we want to "yield" to is running on another CPU
      c) I've seen that pausing sched_yield invocation a bit by placing breakpoint there that automatically continues execution makes v8's context switching effective

      Patch is coming soon

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

        Activity

        Show
        alkondratenko Aleksey Kondratenko (Inactive) added a comment - http://review.couchbase.org/#/c/23580/
        Hide
        thuan Thuan Nguyen added a comment -

        Integrated in github-couchdb-preview #546 (See http://qa.hq.northscale.net/job/github-couchdb-preview/546/)
        MB-7467: added mapreduce test of context usability after timeout (Revision fbb76581ed4188a8039eb10f2c616da418311081)
        MB-7467: use un-lock-ful javascript task termination (Revision 1aaec1b9248d92f360ad38128bb5293c6acac57f)

        Result = SUCCESS
        Filipe David Borba Manana :
        Files :

        • src/mapreduce/test/01-map.t

        Filipe David Borba Manana :
        Files :

        • src/mapreduce/mapreduce.cc
        • src/mapreduce/mapreduce.h
        Show
        thuan Thuan Nguyen added a comment - Integrated in github-couchdb-preview #546 (See http://qa.hq.northscale.net/job/github-couchdb-preview/546/ ) MB-7467 : added mapreduce test of context usability after timeout (Revision fbb76581ed4188a8039eb10f2c616da418311081) MB-7467 : use un-lock-ful javascript task termination (Revision 1aaec1b9248d92f360ad38128bb5293c6acac57f) Result = SUCCESS Filipe David Borba Manana : Files : src/mapreduce/test/01-map.t Filipe David Borba Manana : Files : src/mapreduce/mapreduce.cc src/mapreduce/mapreduce.h
        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-7467: added mapreduce test of context usability after timeout (Revision aa2c26fb3386ee326ce3f204ed7874dd0d60688e)
        MB-7467: use un-lock-ful javascript task termination (Revision 88cc07da63b638988632f4bde1f3e58e692a805a)
        MB-7467 Reset task start time after being interrupted (Revision 1821deebb31e99acec6b5f8d9bc5e7920ae51843)

        Result = SUCCESS
        Filipe David Borba Manana :
        Files :

        • src/mapreduce/test/01-map.t

        Filipe David Borba Manana :
        Files :

        • src/mapreduce/mapreduce.h
        • src/mapreduce/mapreduce.cc

        Filipe David Borba Manana :
        Files :

        • src/mapreduce/mapreduce.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-7467 : added mapreduce test of context usability after timeout (Revision aa2c26fb3386ee326ce3f204ed7874dd0d60688e) MB-7467 : use un-lock-ful javascript task termination (Revision 88cc07da63b638988632f4bde1f3e58e692a805a) MB-7467 Reset task start time after being interrupted (Revision 1821deebb31e99acec6b5f8d9bc5e7920ae51843) Result = SUCCESS Filipe David Borba Manana : Files : src/mapreduce/test/01-map.t Filipe David Borba Manana : Files : src/mapreduce/mapreduce.h src/mapreduce/mapreduce.cc Filipe David Borba Manana : Files : src/mapreduce/mapreduce.cc
        Hide
        maria Maria McDuff (Inactive) added a comment -

        pls verify in current 2.0.2 build. thanks.

        Show
        maria Maria McDuff (Inactive) added a comment - pls verify 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