Hi,

bin/riak-admin js_reload does trigger a Spidermonkey VM realod:

=INFO REPORT==== 27-Apr-2010::12:12:12 ===
Spidermonkey VM host reloaded (<0.111.0>)

but, the cached function does not get flushed. I still have to restart
Riak. Weird.

Also, I was wrong in my last post, it is not related to inner function
definition. Caching is on the complete anonymous function.

Now, after a few tests I noticed that Riak seems to be stuck in error
state once a javascript error is detected. I did the following:

- successfully submitted a javascript mapper, good result, no error
- modified the javascript mapper to introduce an error
- re submitted the javascript mapper, got an expected error:
<<"ReferenceError: find_categories is not defined">>}
- corrected the javascript mapper
- re submitted the mapper and still getting the same error
- bin/riak-admin js_reload, still getting the same error
- bin/riak restart, mapper works, good result, no error

btw, I'm using Riak 0.9.1 on Erlang 5.7.5 and OSX 10.5.8.

Colin

On Tue, Apr 27, 2010 at 12:48 PM, Kevin Smith <ksm...@basho.com> wrote:
> Colin -
>
> You can reload predefined JS functions on a Riak server by running 
> 'riak-admin js_reload'. This should cause Riak to reload all predefined JS 
> functions.
>
> --Kevin
> On Apr 27, 2010, at 11:40 AM, Colin Surprenant wrote:
>
>> Hi,
>>
>> It looks like Riak is caching my named javascript functions WITHIN an
>> anonymous map function.
>>
>> For example my mapper is something similar to:
>>
>> function(v) {
>>  var innerfunction = function(arg) {
>>    ...
>>  }
>>  ...
>> }
>>
>> and modifications to my innerfunction are not picked up when executing
>> my mapreduce job.
>>
>> Is this a known behavior and is there a way for me to control the
>> javascript function caching?
>>
>> Thanks,
>> Colin
>>
>> _______________________________________________
>> riak-users mailing list
>> riak-users@lists.basho.com
>> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
>

_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to