The singular solution in every case was to poke a hole in the hull!
the Q ship fans should read their history. in the case of u boats Q ships are effective only when the sub surfaces and
conducts a attacks according to the ‘cruiser rules’, i.e.
boarding, checking the cargo manifest, evacuate the ship and then scuttle or sink it with gunfire or demolition.
u boat captains quickly realized that a torpedo was a lot faster and safer.