basho/riak_pipe — pull request #38 by seancribbs (2012-01-30 14:43:11+00:00)
Title: Fix race-condition around code loading.

When parallel map-reduce jobs are invoked on a fresh node, they may try to invoke `code:load/1` at the same time, one of them receiving `{file, _}` and one receiving `{error, not_purged}`, which bubbles back to the client through the error clause. Example error from riak_kv as seen in the [Ruby client builds](http://travis-ci.org/#!/basho/riak-ruby-client/jobs/596166/L50):

Phase {kvget_map,0}: module must be a valid module name (failed to load riak_kv_pipe_get: not_purged)

Since the code already being loaded is not an error, really, matching on the `not_purged` clause resolves this issue.