Cannot force quit an application, which is not listed in processes but wont let computer shut down

force quithangshutdown

I was running a computationally intensive code from Rstudio, and it stopped responding. I used forcequit on the app, and tried to restart my computer. Although Rstudio wont show on ps -ax, mac refuses to shut down saying "Rstudio" is still running. When I right click on Rstudio in dock, it says "Application not responding", I think it tried to start itself and failed somehow. On DiagnosticReports I have a .hang file created after this.

My question is, how do I force quit an application when option+command+escape, or right click > Force quit does not work, pid is not listed and cannot see it running in Activity Monitor.

What might be wrong?

Best Answer

sudo reboot worked, I am not sure if this causes any background issues but everything seems okay now.