From b2ae37a481619e8f27f14c293379dd53b1b64766 Mon Sep 17 00:00:00 2001 From: Nathan Acuff Date: Thu, 22 Aug 2019 16:29:27 -0400 Subject: [PATCH 1/6] Update ffi gem and add some exports to the setup script to ensure that ffi native extensions can be installed correctly --- Gemfile | 2 +- script/setup | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 1395a1f..c748a1b 100644 --- a/Gemfile +++ b/Gemfile @@ -3,4 +3,4 @@ source "https://rubygems.org" gemspec # fixes 2.3.0 ffi bundle error -gem 'ffi', '~> 1.0.11' +gem 'ffi', '~> 1.11.0' diff --git a/script/setup b/script/setup index 82b88bf..47fa2f0 100755 --- a/script/setup +++ b/script/setup @@ -7,6 +7,11 @@ rbenv which ruby >/dev/null 2>&1 || (brew upgrade ruby-build || true; rbenv inst # Setup rbenv so we can switch rubies below eval "$(rbenv init - --no-rehash)" +# make sure FFI is fresh and appropriate flags are set to build native extensions +brew reinstall libffi +export LDFLAGS="-L/usr/local/opt/libffi/lib" +export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig" + for ruby_version in `ruby -ryaml -e 'puts YAML.load(File.read(".travis.yml"))["rvm"].join(" ")'`; do rbenv versions --bare | grep "^${ruby_version}$" || rbenv install $ruby_version rbenv shell $ruby_version From 8ffd39638e80b149b8af927a9a264681c9e6b902 Mon Sep 17 00:00:00 2001 From: Nathan Acuff Date: Thu, 22 Aug 2019 16:38:38 -0400 Subject: [PATCH 2/6] Release v3.0.0 --- CHANGELOG.md | 3 +++ lib/instrumental/version.rb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d81af04..8ef974a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +### 3.0.0 [August 23, 2019] +* Update ffi gem and setup script + ### 3.0.0.alpha [August 22, 2019] * Drop support for outdated versions of Ruby * Explicitly add support for new versions of Ruby diff --git a/lib/instrumental/version.rb b/lib/instrumental/version.rb index 39d8a66..40b2dfe 100644 --- a/lib/instrumental/version.rb +++ b/lib/instrumental/version.rb @@ -1,3 +1,3 @@ module Instrumental - VERSION = "3.0.0.alpha" + VERSION = "3.0.0" end From 657feb94de6e9613039b528fad45a88d2b9a88e4 Mon Sep 17 00:00:00 2001 From: Nathan Acuff Date: Mon, 26 Aug 2019 13:37:44 -0400 Subject: [PATCH 3/6] reset failure counter when test_connection succeeds --- lib/instrumental/agent.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/instrumental/agent.rb b/lib/instrumental/agent.rb index e1c60e4..a5be4fc 100644 --- a/lib/instrumental/agent.rb +++ b/lib/instrumental/agent.rb @@ -350,6 +350,7 @@ def wait_exceptions def test_connection begin @socket.read_nonblock(1) + @failures = 0 rescue *wait_exceptions # noop end From a677daa25ae5e8e0c91a5724aa4c6fa3d9d0e7a9 Mon Sep 17 00:00:00 2001 From: Nathan Acuff Date: Tue, 27 Aug 2019 16:22:36 -0400 Subject: [PATCH 4/6] add some extra logging code around errors in test_connection. this is temporary --- lib/instrumental/agent.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/instrumental/agent.rb b/lib/instrumental/agent.rb index a5be4fc..8a158c0 100644 --- a/lib/instrumental/agent.rb +++ b/lib/instrumental/agent.rb @@ -352,7 +352,10 @@ def test_connection @socket.read_nonblock(1) @failures = 0 rescue *wait_exceptions - # noop + # no-op + @logger.error "test connection failed with a wait exception in #{Process.pid}" + rescue Exception => e + @logger.error "test connection failed with an unknown exception #{e.class} in #{Process.pid}" end end From 51b6e06f880159b1811a9c6e6e5bc4d2d7ee37c9 Mon Sep 17 00:00:00 2001 From: Nathan Acuff Date: Tue, 27 Aug 2019 16:44:58 -0400 Subject: [PATCH 5/6] only log exceptions in test_connection if @logger is present --- lib/instrumental/agent.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/instrumental/agent.rb b/lib/instrumental/agent.rb index 8a158c0..12c54f7 100644 --- a/lib/instrumental/agent.rb +++ b/lib/instrumental/agent.rb @@ -351,11 +351,12 @@ def test_connection begin @socket.read_nonblock(1) @failures = 0 - rescue *wait_exceptions + rescue *wait_exceptions => e # no-op - @logger.error "test connection failed with a wait exception in #{Process.pid}" + @logger.error "test connection failed with a wait exception in #{Process.pid}" if @logger rescue Exception => e - @logger.error "test connection failed with an unknown exception #{e.class} in #{Process.pid}" + @logger.error "test connection failed with an unknown exception #{e.class} in #{Process.pid}" if @logger + raise e end end From bd443c0e44b6f0b9b159058564438f5800b20e37 Mon Sep 17 00:00:00 2001 From: Nathan Acuff Date: Wed, 28 Aug 2019 12:19:24 -0400 Subject: [PATCH 6/6] back out additional logging in test_connection --- lib/instrumental/agent.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/instrumental/agent.rb b/lib/instrumental/agent.rb index 12c54f7..cc72b3c 100644 --- a/lib/instrumental/agent.rb +++ b/lib/instrumental/agent.rb @@ -351,12 +351,8 @@ def test_connection begin @socket.read_nonblock(1) @failures = 0 - rescue *wait_exceptions => e + rescue *wait_exceptions # no-op - @logger.error "test connection failed with a wait exception in #{Process.pid}" if @logger - rescue Exception => e - @logger.error "test connection failed with an unknown exception #{e.class} in #{Process.pid}" if @logger - raise e end end