Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-372

Ruby lib doesn't rescue properly from lack of native_thrift extension

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • None
    • 0.1
    • Ruby - Library
    • None
    • Patch Available

    Description

      Files that try to load thrift_native need to rescue from LoadError. LoadError isn't a StandardError, so isn't caught by a bare rescue.

      From current HEAD (757825).

      Clio:rb kev$ g g thrift_native
      Manifest:ext/thrift_native.c
      ext/extconf.rb:create_makefile 'thrift_native'
      ext/thrift_native.c:void Init_thrift_native() {
      lib/thrift/protocol/binaryprotocolaccelerated.rb:require 'thrift_native'
      spec/protocol_spec.rb:require "thrift_native"
      spec/spec_helper.rb:require "thrift_native"

      We may want to put the require for the extension in a ruby file, and just rescue there. That way load path stuff is taken care of properly, and we get our rescue.

      Attachments

        1. thrift-372.patch
          2 kB
          Bryan Duxbury

        Activity

          People

            bryanduxbury Bryan Duxbury
            kclark Kevin Clark
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: