You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by Paul Davis <pa...@gmail.com> on 2009/05/22 16:57:00 UTC

Re: [jira] Closed: (COUCHDB-354) Ungraceful behaviour if view returns a function

On Fri, May 22, 2009 at 10:44 AM, Jan Lehnardt (JIRA) <ji...@apache.org> wrote:
>
>     [ https://issues.apache.org/jira/browse/COUCHDB-354?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
>
> Jan Lehnardt closed COUCHDB-354.
> --------------------------------
>
>    Resolution: Fixed
>
>> * libmozjs0d 1.8.1.16+nobinonly-0ubuntu1
>      ^^^^^^^^^^^^^^^^^ - I believe this to be a non-stable release. Can you please try with 1.7?
>

We're gonna start seeing this alot more. 1.8.1 is supposed to have an
RC candidate coming out this week or next. I've got that work from the
JS profiling in my github repo. I'll take a look at getting couchjs to
build with either version.

>> Ungraceful behaviour if view returns a function
>> -----------------------------------------------
>>
>>                 Key: COUCHDB-354
>>                 URL: https://issues.apache.org/jira/browse/COUCHDB-354
>>             Project: CouchDB
>>          Issue Type: Improvement
>>          Components: JavaScript View Server
>>         Environment: {"couchdb":"Welcome","version":"0.10.0a776990"}
>>            Reporter: Brian Candler
>>            Priority: Minor
>>         Attachments: barf.log, test_reduce_barf.rb
>>
>>
>> If a typo in a view definition causes it to return a function instead of a normal value:
>> * the view server crashes
>> * you get a huge Erlang barf in the log with worrying messages like "OS process timed out" and "brutal kill"
>> I got all this just by accidentally writing "vs.shift" instead of "vs.shift()"
>> The fundamental problem is that a function cannot be serialised in toJSON, but the error message is not helpful:
>> OS Process Log Message: Error converting object to JSON: TypeError: {Array:function (v) {var ... snip loads ... "Object"] is not a function
>> When actually the problem is that the object I was trying to convert *was* a function :-)
>> I will attach some code which replicates this, and the barf generated.
>> Of course this is entirely down to user error in an invalid map/reduce function. However there's already a clean error for 'undefined', maybe this could be done for 'function' too (or indeed any non-serialisable entity)
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>