When you say "before", does that mean before you had a problem with the engine stopping or as a result of something you did to fix it? And was the sparking in the area of that fat center rail? Sometimes you can see exactly where the sparking occurs by looking for pitting on the rail (or someplace on the engine as well). If the roller is contacting a rail other than the center, there will be pitting there. And it will stop the engine.
Roger