BF-195 modified non-terminating map reduce function to sleep instead of spinning

(cherry picked from commit 0056ff1c76e30011c6b0688e528ad7a15e0e8591)