[khodit' krayu propasti]

To walk on a brink of an abyss.

To be in imminent mortal danger; to be on the verge of disaster.

Cf. On a brink of a precipice.