georuby
                                
                                
                                
                                    georuby copied to clipboard
                            
                            
                            
                        GeoRuby::SimpleFeatures::EWKBFormatError errors
When my model refreshes, I'm getting this error sometimes:
      def read_point
        i = @position
        @position += 16
        fail EWKBFormatError.new('Truncated data') if @ewkb.length < @position
        @ewkb.unpack("@#{i}#{@double_mark}#{@double_mark}@*")
      end
I'm getting this in my production and I also get it in my test cases intermittently. My testcases are threaded which is why I thought they were happening.
But... they are also happening on production which is not using threading and it is just normal Rails / Puma. It seems like there is some kind of race condition being hit when the database records are being refresh.
I'm using Sequel orm which might be the source, but I don't think that is causing it.
Can someone give me some insight why this might be happening intermittently?
Nevermind, the other library I was using wasn't threadsafe:
https://github.com/bsears/sequel-postgis-georuby/pull/1
This PR will fix it for those that use Sequel