The codebase uses a lot of threading but doesn't seem to handle locks etc. e.g. The ruby array class is not necessarily thread safe.
Should probably move to a more modern implementation for threads, possibly using;
https://github.com/ruby-concurrency/concurrent-ruby