encratite / RiotControl

An elaborate statistics tracking system for League of Legends. It used to be a centralised PostgreSQL based system but now it's a stand-alone SQLite application. It was written in C# and makes use of the LibOfLegends RTMP library. It is licensed under the terms of the GPLv3. Unfortunately I stopped working on it in 2013-08. Check out the website for a longer explanation.
http://riot.cont.ro.lt/
GNU General Public License v3.0
33 stars 15 forks source link

Application doesn't handle termination gracefully #28

Closed encratite closed 12 years ago

encratite commented 12 years ago

A user on Reddit reported that the application produces a nasty crash dialogue whenever he closes it. This might be a result of other threads throwing exceptions and such when Environment.Exit is being called in another thread. I thought I had covered quite a range of threads with exception handlers already. Unluckily I have never experienced this one myself and so far I have been unable to reproduce this bug.

Achieving a full graceful shutdown by gradually shutting down all the threads first might be rather cumbersome as some of them might be performing RPC and might block for 10 seconds. I wanted to shut down the entire thing instantly, by force. SQLite is supposed to be able to handle this anyways.

Even with the current forceful approach it still seems to run in the background for a few seconds until it is finally shut down. That is not desired.

encratite commented 12 years ago

I tried to tackle this one again but it seems that FluorineFX workers do not return when you close the service so it's pretty much impossible to shut it down cleanly with the current interface. This would require an AMF/RTMP/reflection implementation from scratch, I suspect.

encratite commented 12 years ago

Fixed (I hope) by using the most violent termination possible: https://github.com/epicvrvs/RiotControl/commit/24099beea198094e331bd56089e3453d88a34348