I've had already been aware of the fact that metallic aluminum can be degraded by coming in contact with mercury, but also came across another question more recently here explains a similar reaction with liquid gallium.
So my question is more general regarding corrosive action of any liquid metal on other metals.
What are the more general conditions for a liquid metal to be corrosive to another, different solid metal?
Perhaps the word corrosive is not the most suitable choice. Corrosion refers to a chemical reaction. If I understand it right what's happening, at least in the case of $\ce{Ga}$ and $\ce{Hg}$ on $\ce{Al}$, is a weakening of the grain boundaries by displacement and amalgamation.
Another interesting thought occurred to me. Liquid sodium is often used as a coolant in nuclear power plants. It's pumped through metal pipe (material unknown). So here is a good example of a combination that doesn't lead to corrosion. Are there examples other than I've mentioned that lead to corrosion? So what makes the difference?