Using Triac to control solenoid
Whether you use a relay or a TRIAC, there's a chance the relay contacts could fail closed (welded together) or the TRIAC could fail shorted.  The way to avert a potential catastrophe - if either of those happens - is to use a non-resettable  thermal fuse which will break the mains connection to the device in case the device should overheat.