CouchDB
  1. CouchDB
  2. COUCHDB-752

InternalError: script stack space quota is exhausted

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 0.11
    • Fix Version/s: 1.1.1, 1.2
    • Component/s: JavaScript View Server
    • Labels:
      None
    • Skill Level:
      Regular Contributors Level (Easy to Medium)

      Description

      Couchdb freeze and use full CPU after accessing to a 93MB designdoc:

      debug] [<0.91.0>] Spawning new group server for view group _design/aimpl in database aimpl.
      [debug] [<0.94.0>] request_group

      {Pid, Seq}

      {<0.116.0>,61}

      [debug] [<0.81.0>] New task status for aimpl _design/aimpl: Finishing.
      [debug] [<0.126.0>] OS Process Start :: #Port<0.2040>
      [debug] [<0.87.0>] Teach ddoc to new proc {proc,<0.126.0>,<<"javascript">>,[],

      {couch_os_process,prompt}

      ,

      {couch_os_process,set_timeout}

      ,
      {couch_os_process,stop}} with DDocKey:

      {<<"_design/aimpl">>, <<"30-2ab623a62b83b0d9f2616ee209f62659">>}

      InternalError: script stack space quota is exhausted

      Most of data are in attachments :

      enlil:couchapp benoitc$ du -sh aimpl
      93M aimpl
      enlil:couchapp benoitc$ du -sh aimpl/_attachments/
      93M aimpl/_attachments/

      about 100k in views/shows/...

      1. ddoc.patch
        1 kB
        Benoit Chesneau

        Activity

        Benoit Chesneau created issue -
        Hide
        Benoit Chesneau added a comment -

        With the help of davisp on irc, I tried some stuff. Increasing the stack isn't enough and figured what's the pb.

        There are 23,648 items in _attachments, wich gave a really big string to get as json. Attached patch fix the pb by removing attachments from the ddoc we pass to the function.

        But it only work if the log level is "info, with "debug" level, it try to display the ddoc and then it hangs) .

        Show
        Benoit Chesneau added a comment - With the help of davisp on irc, I tried some stuff. Increasing the stack isn't enough and figured what's the pb. There are 23,648 items in _attachments, wich gave a really big string to get as json. Attached patch fix the pb by removing attachments from the ddoc we pass to the function. But it only work if the log level is "info, with "debug" level, it try to display the ddoc and then it hangs) .
        Benoit Chesneau made changes -
        Field Original Value New Value
        Attachment ddoc.patch [ 12443313 ]
        Noah Slater made changes -
        Fix Version/s 0.11.2 [ 12315196 ]
        Fix Version/s 0.11.1 [ 12314871 ]
        Noah Slater made changes -
        Fix Version/s 0.11.3 [ 12315252 ]
        Fix Version/s 0.11.2 [ 12315196 ]
        Paul Joseph Davis made changes -
        Skill Level Regular Contributors Level (Easy to Medium)
        Jan Lehnardt made changes -
        Fix Version/s 1.2 [ 12315198 ]
        Fix Version/s 0.11.3 [ 12315252 ]
        Randall Leeds made changes -
        Assignee Randall Leeds [ tilgovi ]
        Randall Leeds made changes -
        Fix Version/s 1.1.1 [ 12316395 ]
        Hide
        Randall Leeds added a comment -

        Paul Davis fixed this as part of the work to integrate support for SpiderMonkey 1.8.5. Fixed on 1.1.1 and 1.2. Thanks, Paul!

        Show
        Randall Leeds added a comment - Paul Davis fixed this as part of the work to integrate support for SpiderMonkey 1.8.5. Fixed on 1.1.1 and 1.2. Thanks, Paul!
        Randall Leeds made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Show
        Randall Leeds added a comment - Documented at http://wiki.apache.org/couchdb/Performance#JavaScript_View_Server

          People

          • Assignee:
            Randall Leeds
            Reporter:
            Benoit Chesneau
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development