Home Assistant hangs on restart or stopping

Hi Everyone.
I have been using and tweaking Home assistant for about 2 year now. It is fantastic but i have come accross an issue that i do not know how to rectify.

My Issue is when i go to restart home assistant from the UI under:
Configuration -> Server Controls -> Restart
the system does not restart. It does not seem to completely shut-down and just hangs.
Also if I click the “Stop” - This does the same thing. Does not finish shutting down.

I have checked logs and no issues in my logs what so ever. Only that i am using some custom components.

Checking systemd log for homeassistant process returns the following when it closes down. Which is the same logs that it produced when it was restarting fine.

Jan 20 19:54:13 hassbian hass[1161]: 2020-01-20 19:54:13 INFO (MainThread) [snitun.utils.aiohttp_client] AioHTTP snitun client disconnected from: us-east-1.ui.nabu.casa:443
Jan 20 19:54:13 hassbian hass[1161]: 2020-01-20 19:54:13 INFO (MainThread) [snitun.utils.aiohttp_client] AioHTTP snitun client closed

I have waited for about 10 minutes until it does not fully stop. Then i have to use “sudo systemd restart home-assistant@homeassistant” to get it to restart.
You can then see on on the logs that “Home assistant was stopped” then “Home assistant was started”. Which indicates that the system has not even stopped.
I cannot see any details in any logs of what it is doing when it is not shutting down.
Sometimes the logs come up with this following error, but reading other forums does not seem to be a massive deal:

Jan 18 06:59:47 hassbian hass[11628]: Traceback (most recent call last):
Jan 18 06:59:47 hassbian hass[11628]: File “/usr/local/lib/python3.7/asyncio/sslproto.py”, line 526, in data_received
Jan 18 06:59:47 hassbian hass[11628]: ssldata, appdata = self._sslpipe.feed_ssldata(data)
Jan 18 06:59:47 hassbian hass[11628]: File “/usr/local/lib/python3.7/asyncio/sslproto.py”, line 207, in feed_ssldata
Jan 18 06:59:47 hassbian hass[11628]: self._sslobj.unwrap()
Jan 18 06:59:47 hassbian hass[11628]: File “/usr/local/lib/python3.7/ssl.py”, line 767, in unwrap
Jan 18 06:59:47 hassbian hass[11628]: return self._sslobj.shutdown()
Jan 18 06:59:47 hassbian hass[11628]: ssl.SSLError: [SSL: KRB5_S_INIT] application data after close notify (_ssl.c:2609)

Sometimes if I restart the raspberry pi completely it will restart correctly but not if home assistant has been running for too long.

I am using Hassbian on a raspberry pi 3.

system info:
Distro…: Raspbian GNU/Linux 10 (buster)
Kernel…: Linux 4.19.58-v7+

Uptime…: up 23 hours, 12 minutes
Load…: 3.46 (1m), 3.17 (5m), 3.20 (15m)
Processes…: 117 (root), 13 (user) | 130 (total)

CPU…: ARMv7 Processor rev 4 (v7l)
Memory…: 153Mi used, 333Mi free, 926Mi in total

Please let me know if anyone needs any more details.
Any help would be greatly appreciated as I am completely clueless with this.
Thanks heaps