The documentary grew out of a five-minute piece that Mr. Kondabolu performed on the FX series “Totally Biased With W. Kamau Bell” in 2012. Mindy Kaling had just become the first Indian-American to star in her own series (“The Mindy Project”), and Mr. Kondabolu thought he’d use that breakthrough to talk about Apu, South Asian stereotypes and the struggles of Indians in Hollywood. As a successful standup who has appeared on the Letterman and Jimmy Kimmel shows but who has been heckled with bigoted taunts during other performances, he knew the subject.

But the topic seemed corny and overworked to him. When he took his concerns to Mr. Bell, however, the show host was puzzled. “I was like, no, no one’s talking about this,” Mr. Bell said in a phone interview. “Do you mean like all the other pieces that the South Asian community has done about Apu? And that’s when Hari went, oh yeah, you’re right.”

The piece touched a nerve with audiences, but it was the one-minute section about Apu that people most remembered. Why not make a full-length documentary about his issues with the Kwik-E-Mart owner, Mr. Kondabolu thought, which could serve as a jumping-off point to talk about all the other things the comic had been stewing about?

Working with the director Michael Melamedoff, the film crew began production in April 2016, greenlit by truTV as part of its shift to comedy programming. To tackle the project, he enlisted some high-powered help. In one sequence, the actor Aziz Ansari (“Master of None”) describes being in a car with his dad when a man drives up and asks them where the nearest Quik-E-Mart is. Dr. Vivek Murthy, the 19th surgeon general of the United States, talks about enduring the taunts of an Apu-imitating bully in the seventh grade. And Maulik Pancholy (“30 Rock”) recounts how much he hated going into 7-Eleven stores as a kid, lest his friends see an Indian store clerk and start doing “the Apu thing.”