I had the same problem for two reasons:
First, I had been using a pump with waterproof BC pipes, and the infinite water source would somehow sometimes go dry. Using an aqueous accumulator with liquiducts fixed that (so if you had been using waterproof pipes, see if liquiducts help, they also don't need powered which is a plus).
Second, I had been using golden conductive pipes to power the refineries, as mentioned above, if they have nothing drawing their power, they will fill past capacity and explode. This would happen if my refineries got ahead of the oil being pumped, and shut off, or if my output tank filled up and they had no way to push out more fuel. Switching to redstone conduits solved that problem quite nicely without need for gates or anything like that.