You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Ronny Pfannschmidt (Created) (JIRA)" <ji...@apache.org> on 2012/03/15 20:24:37 UTC

[jira] [Created] (COUCHDB-1441) _rewrite handler loops cause cpu load and swap of death

_rewrite handler loops cause cpu load and swap of death
-------------------------------------------------------

                 Key: COUCHDB-1441
                 URL: https://issues.apache.org/jira/browse/COUCHDB-1441
             Project: CouchDB
          Issue Type: Bug
          Components: HTTP Interface
         Environment: debian testing
            Reporter: Ronny Pfannschmidt


when creating a simple _rewrite loop, the db will start to eat cpu and take more & more memory

for testing i created:

{"_id":"_design/loopa","rewrites":[{"from":"","to":"../loopb/_rewrite"}]}
{"_id":"_design/loopb","rewrites":[{"from":"","to":"../loopa/_rewrite"}]}

accessing $dburi/_design/loopa/_rewrite/ will start the loop

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (COUCHDB-1441) _rewrite handler loops cause cpu load and swap of death

Posted by "Dave Cottlehuber (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-1441?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13230531#comment-13230531 ] 

Dave Cottlehuber commented on COUCHDB-1441:
-------------------------------------------

should have added that this requires admin access to DB or server to do this, its not a DoS opportunity. More like "rm -rf may cause premature data & job loss".
                
> _rewrite handler loops cause cpu load and swap of death
> -------------------------------------------------------
>
>                 Key: COUCHDB-1441
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1441
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: debian testing
>            Reporter: Ronny Pfannschmidt
>
> when creating a simple _rewrite loop, the db will start to eat cpu and take more & more memory
> for testing i created:
> {"_id":"_design/loopa","rewrites":[{"from":"","to":"../loopb/_rewrite"}]}
> {"_id":"_design/loopb","rewrites":[{"from":"","to":"../loopa/_rewrite"}]}
> accessing $dburi/_design/loopa/_rewrite/ will start the loop

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (COUCHDB-1441) _rewrite handler loops cause cpu load and swap of death

Posted by "Alexander Shorin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-1441?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexander Shorin resolved COUCHDB-1441.
---------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.3
                   1.2.1

Already fixed for 1.3: https://git-wip-us.apache.org/repos/asf?p=couchdb.git;a=commit;h=d076976c
and for 1.2.1: https://git-wip-us.apache.org/repos/asf?p=couchdb.git;a=commit;h=30334ac8
                
> _rewrite handler loops cause cpu load and swap of death
> -------------------------------------------------------
>
>                 Key: COUCHDB-1441
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1441
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: debian testing
>            Reporter: Ronny Pfannschmidt
>             Fix For: 1.2.1, 1.3
>
>
> when creating a simple _rewrite loop, the db will start to eat cpu and take more & more memory
> for testing i created:
> {"_id":"_design/loopa","rewrites":[{"from":"","to":"../loopb/_rewrite"}]}
> {"_id":"_design/loopb","rewrites":[{"from":"","to":"../loopa/_rewrite"}]}
> accessing $dburi/_design/loopa/_rewrite/ will start the loop

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (COUCHDB-1441) _rewrite handler loops cause cpu load and swap of death

Posted by "Dave Cottlehuber (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-1441?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13230530#comment-13230530 ] 

Dave Cottlehuber commented on COUCHDB-1441:
-------------------------------------------

Thanks Ronny for raising this!

I don't see how we could deterministically detect this prior to storing the updated ddoc (halting pb).
The question then is can the rewriter track number of traverses and eventually die?
Or do we mark as DNF and note in the appropriate place that you can easily shoot yourself in the foot here?
                
> _rewrite handler loops cause cpu load and swap of death
> -------------------------------------------------------
>
>                 Key: COUCHDB-1441
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1441
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: debian testing
>            Reporter: Ronny Pfannschmidt
>
> when creating a simple _rewrite loop, the db will start to eat cpu and take more & more memory
> for testing i created:
> {"_id":"_design/loopa","rewrites":[{"from":"","to":"../loopb/_rewrite"}]}
> {"_id":"_design/loopb","rewrites":[{"from":"","to":"../loopa/_rewrite"}]}
> accessing $dburi/_design/loopa/_rewrite/ will start the loop

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (COUCHDB-1441) _rewrite handler loops cause cpu load and swap of death

Posted by "Ronny Pfannschmidt (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-1441?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13230723#comment-13230723 ] 

Ronny Pfannschmidt commented on COUCHDB-1441:
---------------------------------------------

a reasonable way to implement this might be to add a counter when rewriting the mochiweb headers in the _rewrite handler

                
> _rewrite handler loops cause cpu load and swap of death
> -------------------------------------------------------
>
>                 Key: COUCHDB-1441
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1441
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: debian testing
>            Reporter: Ronny Pfannschmidt
>
> when creating a simple _rewrite loop, the db will start to eat cpu and take more & more memory
> for testing i created:
> {"_id":"_design/loopa","rewrites":[{"from":"","to":"../loopb/_rewrite"}]}
> {"_id":"_design/loopb","rewrites":[{"from":"","to":"../loopa/_rewrite"}]}
> accessing $dburi/_design/loopa/_rewrite/ will start the loop

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira