georuby icon indicating copy to clipboard operation
georuby copied to clipboard

GeoRuby::SimpleFeatures::EWKBFormatError errors

Open Aryk opened this issue 3 years ago • 1 comments

When my model refreshes, I'm getting this error sometimes:

Screen Shot 2021-01-16 at 8 12 33 PM
      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?

Aryk avatar Jan 16 '21 18:01 Aryk

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

Aryk avatar Jun 03 '21 01:06 Aryk