Sometimes the attack strength can get desynced between the client and the server. It is possible for you to attack fully after the cooldown but it does minimal damage. This happens frequently on servers with a lot of players on them. I believe this is due to a disagreement between the server timing and the client timing. A possible fix for this could be similar to how boats have been changed recently.
Is this still an issue in the most recent versions (currently that is 1.10.2, or 16w42a) of Minecraft? If so, please update the affected versions and help us keeping this ticket updated from time to time.