On using a solenoid to control fluids, opening the valve is a no brainer. However, once the fluid starts flowing, you have "Kinetic" energy stored in the moving fluid.....larger the mass, or faster the velocity, higher the energy content.
When you close the solenoid, abruptly stopping the flow, the energy has to go somewhere. In water pipes in your house they call it "Water Hammer" and hammer release devices are installed.....like a vertical piece of plumbing, capped off containing air, at the washing machine service entrance so that when the washer shuts off the fill function the energy of the flowing water is absorbed by the air... yes in that installation the air is eventually absorbed by the water and over time the available cushion is reduced.......but if you are like me, you have to shut off the water for something whereby the tube empties and is ready for another round.