When pushed against a wall in a horizontal passageway 1 block wide, the player cannot or can rarely be damaged by projectiles from skeletons. I had noticed this behavior in some other mobs, but wasn't able to recreate it. In the attached image, my character is being bombarded with skeleton arrows but is not losing health.
This also happens for other mobs than player. (Example: Villagers attacked by zombies)
(Not sure if villager is only other mob than player.)