A gas water heater shuts off after 30 seconds if the thermocouple is dirty, bent or damaged.