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

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

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

          bryanduxbury Bryan Duxbury added a comment -

          How's this? I cleaned up some missed dead code related to deprecation, as well.

          bryanduxbury Bryan Duxbury added a comment - How's this? I cleaned up some missed dead code related to deprecation, as well.
          kclark Kevin Clark added a comment -

          Looks good. +1

          kclark Kevin Clark added a comment - Looks good. +1
          bryanduxbury Bryan Duxbury added a comment -

          Committed.

          bryanduxbury Bryan Duxbury added a comment - Committed.

          People

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

            Dates

              Created:
              Updated:
              Resolved: