Most every court proceeding is started by filing the initial pleading with the court, then having it served upon the opposing party.
Mandamus is different --
Virginia Code §8.01-644 requires that it be served "a reasonable time" before it's actually filed. I haven't found anything that spells out what period of time is reasonable, but they ended up getting a few weeks, and I'm pretty sure that's fine.
That's strictly for the benefit of government officials. It gives them an opportunity to remedy the problem that warrants a mandamus petition before they're actually dragged into court. The petitioner, on the other hand, still has to draft a petition that will carry the day, because he doesn't know in advance whether the respondents will repent or hold their ground. I can tell you from personal experience that composing a mandamus petition is a non-trivial exercise, and for something that might never actually sit on a judge's desk. It's just another example of the double-standard that applies when it comes to holding government officials accountable.
In addition to the mandated "reasonable" period, I encountered a delay when I found a technical problem with the service performed on Clerk Hamilton, and had to get process served again. I also experienced delays in getting the petition notarized (thanks for nothing, Bank of America!) and having ten copies printed and bound (your binding machine is broken, OfficeMax?) which weren't particularly easy to work around given my personal and work schedules.
I'll note that in this case, it looks like the Respondents have elected to fight the petition. I figure that if they were going to remedy the situation, they'd have done so by now, and they haven't. I also happened to notice that
Clerk Hamilton's website has been updated with a correct fee, but the requirement to obtain a payment receipt and submit that and other documents to the Police Academy has not been corrected. Compare with Exhibit C from the Petition.