In general the median of a random variable is not uniquely determined. This leads to difficulties in estimation and test theory. This paper suggests a limit process for choosing exactly one median. The choice uses the whole distribution of the random variable in a natural and reasonable way.
"The Natural Median." Ann. Probab. 9 (6) 1041 - 1042, December, 1981. https://doi.org/10.1214/aop/1176994275