If the US is headed for Iran, that would make it understandable that Obama wasn’t too fussed about our troops leaving Iraq. One of the big threats to stability in Iraq is Iran. If Iran is going to be distracted by defending itself, maybe Iraq won’t be bothered as much.
Another datapoint is Saudi. The recently publicized plot against the Saudi ambassador (I think that was his job) would certainly be a factor in the overall equation. It could be that Riyadh is giving the attack a green light.
actuallly if the US was going to invade Iran then it wouldn’t pull troops all the way out of Iraq first. They would leave them in Iraq and move them directly to Iran.