Imagine this scenario: developer A has been working in a time span of 10 years without résumé gaps. Developer B has been working for 9 years and has been taking gaps of 4 months every 3 years. Do you really think there is going to be a big difference between the two developers in terms of skills set? 10, 9, 8 years, it doesn't make a difference at all in terms of accumulated knowledge. But developer B has been doing "something else" during a whole year (3 gaps of 4months each). Maybe he travelled the world and learned a little bit of a couple of languages, and I'd say that's a valuable non-technical skill to have.
As I've said, I see more good than harm in taking a few month off from time to time.
Going back to your question: if it's just for a few months I see no problem at all, and if recruiters ask then just explain what you have post.