You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Filipe Manana (JIRA)" <ji...@apache.org> on 2010/04/16 19:04:25 UTC

[jira] Created: (COUCHDB-740) Fix Erlang view server when calling a filter function

Fix Erlang view server when calling a filter function
-----------------------------------------------------

                 Key: COUCHDB-740
                 URL: https://issues.apache.org/jira/browse/COUCHDB-740
             Project: CouchDB
          Issue Type: Bug
    Affects Versions: 0.11
            Reporter: Filipe Manana
         Attachments: erlang-view-server-filter-function-fix.patch

Reported to the dev mailing list by Ivan Bodunov:

"Hi,

After I wrote my filter in JavaScript I decided to rewrite it in Erlang and
faced some problems.
Even the simplest possible filter written in Erlang causes crashes in
CouchDB.

Filter is
   "filters": { "foo": "fun({Doc},Req) -> true end." }

Command to trigger the filter is
   # curl -X GET http://localhost:5984/mytemp/_changes?filter=erl/foo

Following link contains the crash report:
http://friendpaste.com/6eFpPOtTaaSRiXEvaUEmrZ

CouchDB 0.11 on Mac.
"

patch attached with test

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

        

[jira] Updated: (COUCHDB-740) Fix Erlang view server when calling a filter function

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

Filipe Manana updated COUCHDB-740:
----------------------------------

    Attachment:     (was: erlang-view-server-filter-function-fix.patch)

> Fix Erlang view server when calling a filter function
> -----------------------------------------------------
>
>                 Key: COUCHDB-740
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-740
>             Project: CouchDB
>          Issue Type: Bug
>    Affects Versions: 0.11
>            Reporter: Filipe Manana
>         Attachments: erlang-view-server-filter-function-fix.patch
>
>
> Reported to the dev mailing list by Ivan Bodunov:
> "Hi,
> After I wrote my filter in JavaScript I decided to rewrite it in Erlang and
> faced some problems.
> Even the simplest possible filter written in Erlang causes crashes in
> CouchDB.
> Filter is
>    "filters": { "foo": "fun({Doc},Req) -> true end." }
> Command to trigger the filter is
>    # curl -X GET http://localhost:5984/mytemp/_changes?filter=erl/foo
> Following link contains the crash report:
> http://friendpaste.com/6eFpPOtTaaSRiXEvaUEmrZ
> CouchDB 0.11 on Mac.
> "
> patch attached with test

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

        

[jira] Updated: (COUCHDB-740) Fix Erlang view server when calling a filter function

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

Filipe Manana updated COUCHDB-740:
----------------------------------

    Attachment:     (was: erlang-view-server-filter-function-fix.patch)

> Fix Erlang view server when calling a filter function
> -----------------------------------------------------
>
>                 Key: COUCHDB-740
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-740
>             Project: CouchDB
>          Issue Type: Bug
>    Affects Versions: 0.11
>            Reporter: Filipe Manana
>         Attachments: erlang-view-server-filter-function-fix-3.patch
>
>
> Reported to the dev mailing list by Ivan Bodunov:
> "Hi,
> After I wrote my filter in JavaScript I decided to rewrite it in Erlang and
> faced some problems.
> Even the simplest possible filter written in Erlang causes crashes in
> CouchDB.
> Filter is
>    "filters": { "foo": "fun({Doc},Req) -> true end." }
> Command to trigger the filter is
>    # curl -X GET http://localhost:5984/mytemp/_changes?filter=erl/foo
> Following link contains the crash report:
> http://friendpaste.com/6eFpPOtTaaSRiXEvaUEmrZ
> CouchDB 0.11 on Mac.
> "
> patch attached with test

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

        

[jira] Updated: (COUCHDB-740) Fix Erlang view server when calling a filter function

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

Filipe Manana updated COUCHDB-740:
----------------------------------

    Attachment: erlang-view-server-filter-function-fix.patch

> Fix Erlang view server when calling a filter function
> -----------------------------------------------------
>
>                 Key: COUCHDB-740
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-740
>             Project: CouchDB
>          Issue Type: Bug
>    Affects Versions: 0.11
>            Reporter: Filipe Manana
>         Attachments: erlang-view-server-filter-function-fix.patch
>
>
> Reported to the dev mailing list by Ivan Bodunov:
> "Hi,
> After I wrote my filter in JavaScript I decided to rewrite it in Erlang and
> faced some problems.
> Even the simplest possible filter written in Erlang causes crashes in
> CouchDB.
> Filter is
>    "filters": { "foo": "fun({Doc},Req) -> true end." }
> Command to trigger the filter is
>    # curl -X GET http://localhost:5984/mytemp/_changes?filter=erl/foo
> Following link contains the crash report:
> http://friendpaste.com/6eFpPOtTaaSRiXEvaUEmrZ
> CouchDB 0.11 on Mac.
> "
> patch attached with test

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

        

[jira] Updated: (COUCHDB-740) Fix Erlang view server when calling a filter function

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

Adam Kocoloski updated COUCHDB-740:
-----------------------------------

    Fix Version/s: 0.11.1

> Fix Erlang view server when calling a filter function
> -----------------------------------------------------
>
>                 Key: COUCHDB-740
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-740
>             Project: CouchDB
>          Issue Type: Bug
>    Affects Versions: 0.11
>            Reporter: Filipe Manana
>             Fix For: 0.11.1
>
>         Attachments: erlang-view-server-filter-function-fix-3.patch
>
>
> Reported to the dev mailing list by Ivan Bodunov:
> "Hi,
> After I wrote my filter in JavaScript I decided to rewrite it in Erlang and
> faced some problems.
> Even the simplest possible filter written in Erlang causes crashes in
> CouchDB.
> Filter is
>    "filters": { "foo": "fun({Doc},Req) -> true end." }
> Command to trigger the filter is
>    # curl -X GET http://localhost:5984/mytemp/_changes?filter=erl/foo
> Following link contains the crash report:
> http://friendpaste.com/6eFpPOtTaaSRiXEvaUEmrZ
> CouchDB 0.11 on Mac.
> "
> patch attached with test

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COUCHDB-740) Fix Erlang view server when calling a filter function

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

Filipe Manana updated COUCHDB-740:
----------------------------------

    Attachment: erlang-view-server-filter-function-fix.patch

> Fix Erlang view server when calling a filter function
> -----------------------------------------------------
>
>                 Key: COUCHDB-740
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-740
>             Project: CouchDB
>          Issue Type: Bug
>    Affects Versions: 0.11
>            Reporter: Filipe Manana
>         Attachments: erlang-view-server-filter-function-fix.patch
>
>
> Reported to the dev mailing list by Ivan Bodunov:
> "Hi,
> After I wrote my filter in JavaScript I decided to rewrite it in Erlang and
> faced some problems.
> Even the simplest possible filter written in Erlang causes crashes in
> CouchDB.
> Filter is
>    "filters": { "foo": "fun({Doc},Req) -> true end." }
> Command to trigger the filter is
>    # curl -X GET http://localhost:5984/mytemp/_changes?filter=erl/foo
> Following link contains the crash report:
> http://friendpaste.com/6eFpPOtTaaSRiXEvaUEmrZ
> CouchDB 0.11 on Mac.
> "
> patch attached with test

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

        

[jira] Updated: (COUCHDB-740) Fix Erlang view server when calling a filter function

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

Filipe Manana updated COUCHDB-740:
----------------------------------

    Attachment:     (was: erlang-view-server-filter-function-fix-2.patch)

> Fix Erlang view server when calling a filter function
> -----------------------------------------------------
>
>                 Key: COUCHDB-740
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-740
>             Project: CouchDB
>          Issue Type: Bug
>    Affects Versions: 0.11
>            Reporter: Filipe Manana
>         Attachments: erlang-view-server-filter-function-fix-3.patch
>
>
> Reported to the dev mailing list by Ivan Bodunov:
> "Hi,
> After I wrote my filter in JavaScript I decided to rewrite it in Erlang and
> faced some problems.
> Even the simplest possible filter written in Erlang causes crashes in
> CouchDB.
> Filter is
>    "filters": { "foo": "fun({Doc},Req) -> true end." }
> Command to trigger the filter is
>    # curl -X GET http://localhost:5984/mytemp/_changes?filter=erl/foo
> Following link contains the crash report:
> http://friendpaste.com/6eFpPOtTaaSRiXEvaUEmrZ
> CouchDB 0.11 on Mac.
> "
> patch attached with test

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

        

[jira] Updated: (COUCHDB-740) Fix Erlang view server when calling a filter function

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

Filipe Manana updated COUCHDB-740:
----------------------------------

    Attachment: erlang-view-server-filter-function-fix-3.patch

Looking into it with more attention,

1) couch_query_servers is generating the userCtx json object and passing it to the view server (js or erlang)

2) the userCtx is always present in the Req object, therefore it's useless to serialize the userCtx into json and pass it to the view server, where the only action taken is to pass it to the filter function.

All the tests are still passing. 

There isn't any example in the test cases or the book where the userCtx is being passed as a 3rd argument to a filter function. Therefore this cleanup is highly unlikely to break someone's code. All examples are showing req.userCtx.

> Fix Erlang view server when calling a filter function
> -----------------------------------------------------
>
>                 Key: COUCHDB-740
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-740
>             Project: CouchDB
>          Issue Type: Bug
>    Affects Versions: 0.11
>            Reporter: Filipe Manana
>         Attachments: erlang-view-server-filter-function-fix-2.patch, erlang-view-server-filter-function-fix-3.patch, erlang-view-server-filter-function-fix.patch
>
>
> Reported to the dev mailing list by Ivan Bodunov:
> "Hi,
> After I wrote my filter in JavaScript I decided to rewrite it in Erlang and
> faced some problems.
> Even the simplest possible filter written in Erlang causes crashes in
> CouchDB.
> Filter is
>    "filters": { "foo": "fun({Doc},Req) -> true end." }
> Command to trigger the filter is
>    # curl -X GET http://localhost:5984/mytemp/_changes?filter=erl/foo
> Following link contains the crash report:
> http://friendpaste.com/6eFpPOtTaaSRiXEvaUEmrZ
> CouchDB 0.11 on Mac.
> "
> patch attached with test

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

        

[jira] Closed: (COUCHDB-740) Fix Erlang view server when calling a filter function

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

Chris Anderson closed COUCHDB-740.
----------------------------------

    Resolution: Fixed

closed in 936889 

thanks for the patch!

> Fix Erlang view server when calling a filter function
> -----------------------------------------------------
>
>                 Key: COUCHDB-740
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-740
>             Project: CouchDB
>          Issue Type: Bug
>    Affects Versions: 0.11
>            Reporter: Filipe Manana
>         Attachments: erlang-view-server-filter-function-fix-3.patch
>
>
> Reported to the dev mailing list by Ivan Bodunov:
> "Hi,
> After I wrote my filter in JavaScript I decided to rewrite it in Erlang and
> faced some problems.
> Even the simplest possible filter written in Erlang causes crashes in
> CouchDB.
> Filter is
>    "filters": { "foo": "fun({Doc},Req) -> true end." }
> Command to trigger the filter is
>    # curl -X GET http://localhost:5984/mytemp/_changes?filter=erl/foo
> Following link contains the crash report:
> http://friendpaste.com/6eFpPOtTaaSRiXEvaUEmrZ
> CouchDB 0.11 on Mac.
> "
> patch attached with test

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COUCHDB-740) Fix Erlang view server when calling a filter function

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

Filipe Manana updated COUCHDB-740:
----------------------------------

    Attachment: erlang-view-server-filter-function-fix-2.patch

Forgot that the UserCtx is already within the Req object. Therefore no need to pass it as 3rd argument to the filter function. This patch no longer passes a 3rd argument.

Thanks Chris for reminding me about it at #couchdb.

> Fix Erlang view server when calling a filter function
> -----------------------------------------------------
>
>                 Key: COUCHDB-740
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-740
>             Project: CouchDB
>          Issue Type: Bug
>    Affects Versions: 0.11
>            Reporter: Filipe Manana
>         Attachments: erlang-view-server-filter-function-fix-2.patch, erlang-view-server-filter-function-fix.patch
>
>
> Reported to the dev mailing list by Ivan Bodunov:
> "Hi,
> After I wrote my filter in JavaScript I decided to rewrite it in Erlang and
> faced some problems.
> Even the simplest possible filter written in Erlang causes crashes in
> CouchDB.
> Filter is
>    "filters": { "foo": "fun({Doc},Req) -> true end." }
> Command to trigger the filter is
>    # curl -X GET http://localhost:5984/mytemp/_changes?filter=erl/foo
> Following link contains the crash report:
> http://friendpaste.com/6eFpPOtTaaSRiXEvaUEmrZ
> CouchDB 0.11 on Mac.
> "
> patch attached with test

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