It is narrated from Sayyiduna Jabir (may Allah be pleased with him) that once the Prophet (peace and blessings be upon him) sent me for some task of his. I went, and when I returned after completing the task, I greeted the Prophet (peace and blessings be upon him) with salam, but he did not reply. Allah knows best what passed through my heart. I thought perhaps the Prophet (peace and blessings be upon him) was displeased with me because of my delay. I greeted him again, but still did not receive a reply, and I felt even more distressed than before. But the third time, the Prophet (peace and blessings be upon him) replied and said that nothing prevented me from replying except that I was performing prayer. At that time, the Prophet (peace and blessings be upon him) was on his mount and his face was not towards the qiblah.
Hadith Referenceمسند احمد / مسند المكثرين من الصحابة / 14783