The agent communicates with the SDS when asked to exit. If the SDS is offline or inaccessible, the agent will not be able to be stopped normally and thus cannot be uninstalled.
Kill the agent manually if it hangs.