jruby / activerecord-jdbc-adapter

JRuby's ActiveRecord adapter using JDBC.
BSD 2-Clause "Simplified" License
462 stars 388 forks source link

Is it possible to silence a JDBC logger. #878

Open meetme2meat opened 6 years ago

meetme2meat commented 6 years ago

Every since we updated activerecord-jdbc-adapter to 50.0 we are seeing JDBC error on our STDOUT.

Mar 28, 2018 7:21:16 AM org.postgresql.Driver connect SEVERE: Connection error: org.postgresql.util.PSQLException: Connection attempt timed out. at org.postgresql.Driver$ConnectThread.getResult(Driver.java:414) at org.postgresql.Driver.connect(Driver.java:259) at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:467) at org.jruby.javasupport.JavaMethod.invokeDirect(JavaMethod.java:325) at org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:56) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:193) at usr.local.rvm.gems.jruby_minus_9_dot_0_dot_5_dot_0_at_40_jpolicy_router.gems.activerecord_minus_jdbc_minus_adapter_minus_50_dot_0.lib.arjdbc.jdbc.driver.invokeOther19:connect(/usr/local/rvm/gems/jruby-9.0.5.0@jpolicy_router/gems/activerecord-jdbc-adapter-50.0/lib/arjdbc/jdbc/driver.rb) at usr.local.rvm.gems.jruby_minus_9_dot_0_dot_5_dot_0_at_40_jpolicy_router.gems.activerecord_minus_jdbc_minus_adapter_minus_50_dot_0.lib.arjdbc.jdbc.driver.RUBY$method$connection$0(/usr/local/rvm/gems/jruby-9.0.5.0@jpolicy_router/gems/activerecord-jdbc-adapter-50.0/lib/arjdbc/jdbc/driver.rb:39) at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:161) at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:264) at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:213) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:225) at usr.local.rvm.gems.jruby_minus_9_dot_0_dot_5_dot_0_at_40_jpolicy_router.gems.activerecord_minus_jdbc_minus_adapter_minus_50_dot_0.lib.arjdbc.jdbc.connection.invokeOther4:connection(/usr/local/rvm/gems/jruby-9.0.5.0@jpolicy_router/gems/activerecord-jdbc-adapter-50.0/lib/arjdbc/jdbc/connection.rb) at usr.local.rvm.gems.jruby_minus_9_dot_0_dot_5_dot_0_at_40_jpolicy_router.gems.activerecord_minus_jdbc_minus_adapter_minus_50_dot_0.lib.arjdbc.jdbc.connection.RUBY$method$newConnection$0(/usr/local/rvm/gems/jruby-9.0.5.0@jpolicy_router/gems/activerecord-jdbc-adapter-50.0/lib/arjdbc/jdbc/connection.rb:120) at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:101) at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:124) at ActiveRecord$$ConnectionAdapters$$JdbcConnection$$JdbcConnectionFactoryImpl_636471892.newConnection(ActiveRecord$$ConnectionAdapters$$JdbcConnection$$JdbcConnectionFactoryImpl_636471892.gen:13) at arjdbc.postgresql.PostgreSQLRubyJdbcConnection.newConnection(PostgreSQLRubyJdbcConnection.java:199) at arjdbc.jdbc.RubyJdbcConnection.initConnection(RubyJdbcConnection.java:429) at arjdbc.jdbc.RubyJdbcConnection.init_connection(RubyJdbcConnection.java:421) at arjdbc.jdbc.RubyJdbcConnection$INVOKER$i$0$0$init_connection.call(RubyJdbcConnection$INVOKER$i$0$0$init_connection.gen) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:129) at usr.local.rvm.gems.jruby_minus_9_dot_0_dot_5_dot_0_at_40_jpolicy_router.gems.activerecord_minus_jdbc_minus_adapter_minus_50_dot_0.lib.arjdbc.jdbc.connection.invokeOther5:init_connection(/usr/local/rvm/gems/jruby-9.0.5.0@jpolicy_router/gems/activerecord-jdbc-adapter-50.0/lib/arjdbc/jdbc/connection.rb) at usr.local.rvm.gems.jruby_minus_9_dot_0_dot_5_dot_0_at_40_jpolicy_router.gems.activerecord_minus_jdbc_minus_adapter_minus_50_dot_0.lib.arjdbc.jdbc.connection.RUBY$method$initialize$0(/usr/local/rvm/gems/jruby-9.0.5.0@jpolicy_router/gems/activerecord-jdbc-adapter-50.0/lib/arjdbc/jdbc/connection.rb:15) at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:101) at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:144) at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:229) at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:203) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:209) at org.jruby.RubyClass.newInstance(RubyClass.java:877) at org.jruby.RubyClass$INVOKER$i$newInstance.call(RubyClass$INVOKER$i$newInstance.gen) at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:205) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:193) at usr.local.rvm.gems.jruby_minus_9_dot_0_dot_5_dot_0_at_40_jpolicy_router.gems.activerecord_minus_jdbc_minus_adapter_minus_50_dot_0.lib.arjdbc.abstract.core.invokeOther4:new(/usr/local/rvm/gems/jruby-9.0.5.0@jpolicy_router/gems/activerecord-jdbc-adapter-50.0/lib/arjdbc/abstract/core.rb) at usr.local.rvm.gems.jruby_minus_9_dot_0_dot_5_dot_0_at_40_jpolicy_router.gems.activerecord_minus_jdbc_minus_adapter_minus_50_dot_0.lib.arjdbc.abstract.core.RUBY$method$initialize$0(/usr/local/rvm/gems/jruby-9.0.5.0@jpolicy_router/gems/activerecord-jdbc-adapter-50.0/lib/arjdbc/abstract/core.rb:13) at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:101) at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:124) at org.jruby.ir.runtime.IRRuntimeHelpers.unresolvedSuper(IRRuntimeHelpers.java:965) at org.jruby.ir.runtime.IRRuntimeHelpers.unresolvedSuperSplatArgs(IRRuntimeHelpers.java:947) at usr.local.rvm.gems.jruby_minus_9_dot_0_dot_5_dot_0_at_40_jpolicy_router.gems.activerecord_minus_jdbc_minus_adapter_minus_50_dot_0.lib.arjdbc.abstract.statement_cache.invokeSuper0:-unknown-super-target-(/usr/local/rvm/gems/jruby-9.0.5.0@jpolicy_router/gems/activerecord-jdbc-adapter-50.0/lib/arjdbc/abstract/statement_cache.rb) at usr.local.rvm.gems.jruby_minus_9_dot_0_dot_5_dot_0_at_40_jpolicy_router.gems.activerecord_minus_jdbc_minus_adapter_minus_50_dot_0.lib.arjdbc.abstract.statement_cache.RUBY$method$initialize$0(/usr/local/rvm/gems/jruby-9.0.5.0@jpolicy_router/gems/activerecord-jdbc-adapter-50.0/lib/arjdbc/abstract/statement_cache.rb:21) at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:101) at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:124) at org.jruby.ir.runtime.IRRuntimeHelpers.instanceSuper(IRRuntimeHelpers.java:927) at org.jruby.ir.runtime.IRRuntimeHelpers.instanceSuperSplatArgs(IRRuntimeHelpers.java:920) at usr.local.rvm.gems.jruby_minus_9_dot_0_dot_5_dot_0_at_40_jpolicy_router.gems.activerecord_minus_jdbc_minus_adapter_minus_50_dot_0.lib.arjdbc.postgresql.adapter.invokeSuper1:initialize(/usr/local/rvm/gems/jruby-9.0.5.0@jpolicy_router/gems/activerecord-jdbc-adapter-50.0/lib/arjdbc/postgresql/adapter.rb) at usr.local.rvm.gems.jruby_minus_9_dot_0_dot_5_dot_0_at_40_jpolicy_router.gems.activerecord_minus_jdbc_minus_adapter_minus_50_dot_0.lib.arjdbc.postgresql.adapter.RUBY$method$initialize$0(/usr/local/rvm/gems/jruby-9.0.5.0@jpolicy_router/gems/activerecord-jdbc-adapter-50.0/lib/arjdbc/postgresql/adapter.rb:791) at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:101) at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:159) at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:264) at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:235) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:241) at org.jruby.RubyClass.newInstance(RubyClass.java:884) at org.jruby.RubyClass$INVOKER$i$newInstance.call(RubyClass$INVOKER$i$newInstance.gen) at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:213) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:225) at usr.local.rvm.gems.jruby_minus_9_dot_0_dot_5_dot_0_at_40_jpolicy_router.gems.activerecord_minus_jdbc_minus_adapter_minus_50_dot_0.lib.arjdbc.jdbc.connection_methods.invokeOther17:new(/usr/local/rvm/gems/jruby-9.0.5.0@jpolicy_router/gems/activerecord-jdbc-adapter-50.0/lib/arjdbc/jdbc/connection_methods.rb) at usr.local.rvm.gems.jruby_minus_9_dot_0_dot_5_dot_0_at_40_jpolicy_router.gems.activerecord_minus_jdbc_minus_adapter_minus_50_dot_0.lib.arjdbc.jdbc.connection_methods.RUBY$method$jdbc_connection$0(/usr/local/rvm/gems/jruby-9.0.5.0@jpolicy_router/gems/activerecord-jdbc-adapter-50.0/lib/arjdbc/jdbc/connection_methods.rb:17) at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:131) at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:194) at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:197) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:161) at usr.local.rvm.gems.jruby_minus_9_dot_0_dot_5_dot_0_at_40_jpolicy_router.gems.activerecord_minus_jdbc_minus_adapter_minus_50_dot_0.lib.arjdbc.postgresql.connection_methods.invokeOther247:jdbc_connection(/usr/local/rvm/gems/jruby-9.0.5.0@jpolicy_router/gems/activerecord-jdbc-adapter-50.0/lib/arjdbc/postgresql/connection_methods.rb) at usr.local.rvm.gems.jruby_minus_9_dot_0_dot_5_dot_0_at_40_jpolicy_router.gems.activerecord_minus_jdbc_minus_adapter_minus_50_dot_0.lib.arjdbc.postgresql.connection_methods.RUBY$method$postgresql_connection$0(/usr/local/rvm/gems/jruby-9.0.5.0@jpolicy_router/gems/activerecord-jdbc-adapter-50.0/lib/arjdbc/postgresql/connection_methods.rb:48) at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:131) at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:194) at org.jruby.RubyClass.finvoke(RubyClass.java:560) at org.jruby.RubyBasicObject.send19(RubyBasicObject.java:1605) at org.jruby.RubyKernel.send19(RubyKernel.java:2001) at org.jruby.RubyKernel$INVOKER$s$send19.call(RubyKernel$INVOKER$s$send19.gen) at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:205) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:193) at usr.local.rvm.gems.jruby_minus_9_dot_0_dot_5_dot_0_at_40_jpolicy_router.gems.activerecord_minus_5_dot_0_dot_6.lib.active_record.connection_adapters.abstract.connection_pool.invokeOther19:send(/usr/local/rvm/gems/jruby-9.0.5.0@jpolicy_router/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb) at usr.local.rvm.gems.jruby_minus_9_dot_0_dot_5_dot_0_at_40_jpolicy_router.gems.activerecord_minus_5_dot_0_dot_6.lib.active_record.connection_adapters.abstract.connection_pool.RUBY$method$new_connection$0(/usr/local/rvm/gems/jruby-9.0.5.0@jpolicy_router/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:729) at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:116) at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:159) at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:189) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:129) at usr.local.rvm.gems.jruby_minus_9_dot_0_dot_5_dot_0_at_40_jpolicy_router.gems.activerecord_minus_5_dot_0_dot_6.lib.active_record.connection_adapters.abstract.connection_pool.invokeOther5:new_connection(/usr/local/rvm/gems/jruby-9.0.5.0@jpolicy_router/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb) at usr.local.rvm.gems.jruby_minus_9_dot_0_dot_5_dot_0_at_40_jpolicy_router.gems.activerecord_minus_5_dot_0_dot_6.lib.active_record.connection_adapters.abstract.connection_pool.RUBY$method$checkout_new_connection$0(/usr/local/rvm/gems/jruby-9.0.5.0@jpolicy_router/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:773) at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:116) at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:159) at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:189) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:129) at usr.local.rvm.gems.jruby_minus_9_dot_0_dot_5_dot_0_at_40_jpolicy_router.gems.activerecord_minus_5_dot_0_dot_6.lib.active_record.connection_adapters.abstract.connection_pool.invokeOther61:checkout_new_connection(/usr/local/rvm/gems/jruby-9.0.5.0@jpolicy_router/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb) at usr.local.rvm.gems.jruby_minus_9_dot_0_dot_5_dot_0_at_40_jpolicy_router.gems.activerecord_minus_5_dot_0_dot_6.lib.active_record.connection_adapters.abstract.connection_pool.RUBY$method$try_to_checkout_new_connection$0(/usr/local/rvm/gems/jruby-9.0.5.0@jpolicy_router/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:752) at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:116) at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:159) at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:189) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:129) at usr.local.rvm.gems.jruby_minus_9_dot_0_dot_5_dot_0_at_40_jpolicy_router.gems.activerecord_minus_5_dot_0_dot_6.lib.active_record.connection_adapters.abstract.connection_pool.invokeOther8:try_to_checkout_new_connection(/usr/local/rvm/gems/jruby-9.0.5.0@jpolicy_router/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb) at usr.local.rvm.gems.jruby_minus_9_dot_0_dot_5_dot_0_at_40_jpolicy_router.gems.activerecord_minus_5_dot_0_dot_6.lib.active_record.connection_adapters.abstract.connection_pool.RUBY$method$acquire_connection$0(/usr/local/rvm/gems/jruby-9.0.5.0@jpolicy_router/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:713) at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:131) at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:194) at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:197) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:161) at usr.local.rvm.gems.jruby_minus_9_dot_0_dot_5_dot_0_at_40_jpolicy_router.gems.activerecord_minus_5_dot_0_dot_6.lib.active_record.connection_adapters.abstract.connection_pool.invokeOther1:acquire_connection(/usr/local/rvm/gems/jruby-9.0.5.0@jpolicy_router/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb) at usr.local.rvm.gems.jruby_minus_9_dot_0_dot_5_dot_0_at_40_jpolicy_router.gems.activerecord_minus_5_dot_0_dot_6.lib.active_record.connection_adapters.abstract.connection_pool.RUBY$method$checkout$0(/usr/local/rvm/gems/jruby-9.0.5.0@jpolicy_router/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:490) at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:101) at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:112) at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:159) at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:189) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:129) at usr.local.rvm.gems.jruby_minus_9_dot_0_dot_5_dot_0_at_40_jpolicy_router.gems.activerecord_minus_5_dot_0_dot_6.lib.active_record.connection_adapters.abstract.connection_pool.invokeOther10:checkout(/usr/local/rvm/gems/jruby-9.0.5.0@jpolicy_router/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb) at usr.local.rvm.gems.jruby_minus_9_dot_0_dot_5_dot_0_at_40_jpolicy_router.gems.activerecord_minus_5_dot_0_dot_6.lib.active_record.connection_adapters.abstract.connection_pool.RUBY$method$connection$0(/usr/local/rvm/gems/jruby-9.0.5.0@jpolicy_router/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:364) at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:116) at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:159) at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:189) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:129) at usr.local.rvm.gems.jruby_minus_9_dot_0_dot_5_dot_0_at_40_jpolicy_router.gems.activerecord_minus_5_dot_0_dot_6.lib.active_record.connection_adapters.abstract.connection_pool.invokeOther11:connection(/usr/local/rvm/gems/jruby-9.0.5.0@jpolicy_router/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb) at usr.local.rvm.gems.jruby_minus_9_dot_0_dot_5_dot_0_at_40_jpolicy_router.gems.activerecord_minus_5_dot_0_dot_6.lib.active_record.connection_adapters.abstract.connection_pool.RUBY$method$with_connection$0(/usr/local/rvm/gems/jruby-9.0.5.0@jpolicy_router/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:395) at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:116) at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:159) at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:139) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:145) at srv.apps.policy_router.releases.$20180328042701.lib.policy_router.scp_lookup.invokeOther23:with_connection(/srv/apps/policy_router/releases/20180328042701/lib/policy_router/scp_lookup.rb) at srv.apps.policy_router.releases.$20180328042701.lib.policy_router.scp_lookup.RUBY$method$find$0(/srv/apps/policy_router/releases/20180328042701/lib/policy_router/scp_lookup.rb:5) at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:131) at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:194) at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:197) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:161) at srv.apps.policy_router.releases.$20180328042701.lib.policy_router.events.route_event.invokeOther1:find(/srv/apps/policy_router/releases/20180328042701/lib/policy_router/events/route_event.rb) at srv.apps.policy_router.releases.$20180328042701.lib.policy_router.events.route_event.RUBY$block$route$1(/srv/apps/policy_router/releases/20180328042701/lib/policy_router/events/route_event.rb:48) at org.jruby.runtime.CompiledIRBlockBody.yieldDirect(CompiledIRBlockBody.java:140) at org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:73) at org.jruby.runtime.Block.yieldSpecific(Block.java:135) at org.jruby.ir.runtime.IRRuntimeHelpers.yieldSpecific(IRRuntimeHelpers.java:480) at srv.apps.policy_router.releases.$20180328042701.lib.policy_router.threshold.RUBY$method$track_event$0(/srv/apps/policy_router/releases/20180328042701/lib/policy_router/threshold.rb:27) at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:131) at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:194) at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:171) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:177) at srv.apps.policy_router.releases.$20180328042701.lib.policy_router.events.route_event.invokeOther32:track_event(/srv/apps/policy_router/releases/20180328042701/lib/policy_router/events/route_event.rb) at srv.apps.policy_router.releases.$20180328042701.lib.policy_router.events.route_event.RUBY$method$route$0(/srv/apps/policy_router/releases/20180328042701/lib/policy_router/events/route_event.rb:45) at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:101) at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:112) at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:159) at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:189) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:129) at srv.apps.policy_router.releases.$20180328042701.lib.policy_router.events.reply_event.invokeOther22:route(/srv/apps/policy_router/releases/20180328042701/lib/policy_router/events/reply_event.rb) at srv.apps.policy_router.releases.$20180328042701.lib.policy_router.events.reply_event.RUBY$method$handle_route_check_response$0(/srv/apps/policy_router/releases/20180328042701/lib/policy_router/events/reply_event.rb:30) at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:116) at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:159) at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:189) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:129) at srv.apps.policy_router.releases.$20180328042701.lib.policy_router.events.reply_event.invokeOther51:handle_route_check_response(/srv/apps/policy_router/releases/20180328042701/lib/policy_router/events/reply_event.rb) at srv.apps.policy_router.releases.$20180328042701.lib.policy_router.events.reply_event.RUBY$method$reply$0(/srv/apps/policy_router/releases/20180328042701/lib/policy_router/events/reply_event.rb:14) at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:116) at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:159) at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:189) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:129) at srv.apps.policy_router.releases.$20180328042701.lib.policy_router.eval_response.invokeOther53:reply(/srv/apps/policy_router/releases/20180328042701/lib/policy_router/eval_response.rb) at srv.apps.policy_router.releases.$20180328042701.lib.policy_router.eval_response.RUBY$method$execute_event$0(/srv/apps/policy_router/releases/20180328042701/lib/policy_router/eval_response.rb:28) at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:131) at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:194) at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:197) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:161) at srv.apps.policy_router.releases.$20180328042701.lib.policy_router.response_handler.invokeOther3:execute_event(/srv/apps/policy_router/releases/20180328042701/lib/policy_router/response_handler.rb) at srv.apps.policy_router.releases.$20180328042701.lib.policy_router.response_handler.RUBY$method$handle_event$0(/srv/apps/policy_router/releases/20180328042701/lib/policy_router/response_handler.rb:92) at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:116) at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:159) at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:189) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:129)

While I understand the error part but its kind of very frightening and confusing at times (when the code has all the rescue enable to log the error to a file) to see this on our STDOUT.

Plus I'm not sure that extra IO operation takes some performance hit when a Large number of db failure issue happens and when we need to respond as very fast.

I happen to find the source of the JDBC adapter where this happens here and the Logger is defined over here

But... I'm not sure how to handle this ..

In the end, I'm really not sure if this is the right place to report this error.

activerecord (5.0.6) activerecord-jdbc-adapter (50.0) java version "1.8.0_74" Java(TM) SE Runtime Environment (build 1.8.0_74-b02) Java HotSpot(TM) 64-Bit Server VM (build 25.74-b02, mixed mode)

kares commented 6 years ago

simply silence the JUL logger. that should work, however this is a driver thing - not much AR-JDBC's fault

enebo commented 6 years ago

@kares I am not sure most users would agree with you though. If I use something which is meant to be giving a particular feel (e.g. AR clone), then I do not expect to see the implementation details leak out onto my screen. Another side of this is if these details are important to how the db is actually behaving perhaps we should be connecting this to rails logging? Final thought is many people who use JRuby are not Java programmers and do not have any idea how Java logging works to disable it.

kares commented 6 years ago

@enebo hey, did check that there's the same issue opened at pgjdbc. the error message got introduced in some recent driver version and they seem to be doing something about it (according to comments on the tracker). it wasn't printing this prior to version 42. believe @meetme2meat noticed that as well and will agree there's no need to double the investigation here.

while your ideas seems legit and fine, I do not see pushing them forward - we did not even restore JNDI support (yet) and with caching at .rb side I'm not sure anyone has thought it through ...

Another side of this is if these details are important to how the db is actually behaving perhaps we should be connecting this to rails logging?

if you ask me - we definitely do not want to do this esp. if you're for that particular AR clone feel :)

Final thought is many people who use JRuby are not Java programmers and do not have any idea how Java logging works to disable it.

this isn't the case here as user understood he's using a Java driver and opened an issue at the proper place.

will wrap up slowly ... and I am leaving this up to you than.

enebo commented 6 years ago

@kares I am still a little confused about this. I only saw the linked issue over there yesterday (which really looks like wontfix from the comments) but this morning I noticed the PR which will reduce the log to warn (which I am guessing warns do not log by default). So, if they are changing it back then that means a future version will again not display to console. Don't we bundle the version which does this though? We will need to at a minimum change the version of the pg driver OR silence the noise OR ignore it until a new version comes out then update the version. Seems like all paths require some action on our part.

I was not really sure how important it is to propagate the log errors so that was a question. Pushing them through to AR probably would also generate user reports; so I can see that potentially opening up another source of user reports.

While the reporter may know how to work around this issue I am hoping he is not our sole postgresql user. I mostly brought up that last point because we will just end up getting this reported again until we change something.

kares commented 6 years ago

believe its not important much - we do not care about native SQLException by (default) now. in this case I thought it to be obvious - AR call generated a non-existent DB error and we do not care.

we have a work-around locally (for tests) but that is really unfortunate to be the resolution by AR-JDBC as users who might have tuned their JUL with a configuration (e.g. for driver debugging) we would blow over.

... the only 'good' option would be to fork the driver but there's activity on driver's end to resolve. that is why I closed the issue here.

on a related end the (recent) increased usage of PG's JDBC API has gotten us tighter to a driver version, which wasn't the case in the past but we're slowly heading there - so maybe forking is an eventual option :)

enebo commented 6 years ago

@kares I wonder if we could just go back one version until the next one is out. I don't think we updated this driver before 5.x work for several years. Perhaps being a little out of date and not having spurious errors going to console is preferable? (I have not see what was fixed so I guess that is a big factor in that idea).

I will talk to you on irc about what you mean about API. I think you mean we are using newer features of pg itself which only newer APIs support but I am unsure.

meetme2meat commented 6 years ago

@kares @enebo Thanks for help.

@kares like you suggested. All that is the need to do is, this..

java_import "java.util.logging.LogManager"
LogManager.get_log_manager().reset() 

I don't see those logs after I do this... But I'm certainly not sure if this is the correct way to do it.