The problem occurs when the metal rod in-glass lined water heaters (used to improve the life expectancy of the glass lining) combines with waterborne sulfate-reducing bacteria (not harmful to consume), resulting in the production of hydrogen sulfide. The water is not dangerous to consume, but is difficult to swallow if you dislike the smell of rotten eggs.
Solution 1: Replace the magnesium metal rod (cathodic protection anode) with one made of aluminum (it may not be available for your brand water heater). The aluminum rod produces 30% less current and therefore generates less hydrogen gas, while causing enough current to adequately protect the glass liner.
Solution 2: We do not recommend this alternative. Doing so will void the manufacturer's warranty. Complete removal of the metal rod can be accomplished by unscrewing it from the tank and replacing it with a threaded plug.
Solution 3: Find the origination point of the sulfate-reducing bacteria (SRB) and eliminate it. SRB is most prevalent in new-water supply pipes contaminated by soil during construction. The soil carrying the SRB eventually ends up as solids at the bottom of the water heater. A thorough flushing to remove the dirt, then a second flushing with a dash of chlorine, and finally a third flush to clean should do the trick. Hydrogen gas without the presence of SRB will go unnoticed. SRB is not so easy to remove if your water company pumps the bacteria into your home right along with the water. This will, in fact, be the case as more and more water districts continue to reduce or cease their use of chlorine (as many have). Sulfate-reducing bacteria are devastated by chlorination, but will thrive otherwise.
It is possible to inadvertently contaminate your own water supply by allowing sulfate-reducing bacteria (not to mention other more dangerous bugs) to enter your water system at your own property through your sprinklers for example, by not using anti-siphon sprinkler valves which prevent "backwash". Backwash could also result when a water main in your neighborhood is turned off while your garden hose is running in a muddy puddle.