It happening lots when you turn on your wall switch and nothing happens to your main burner or your pilot flame turn of itself, mostly thermocouple failed and also thermopile too, sometimes you replace both sensors and you still have the same problem, after that, you have to replace gas control valve to fix the problem.