You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to this method signature check, my consumer crashes on start with Racecar 2.3.0 and newer:
=> Starting Racecar consumer DataConsumer...
=> Detected Rails, booting application...
=> Ctrl-C to shutdown consumer
=> Wrooooom!
=> Crashed: Racecar::Error: Invalid method signature for `process`. The method must take exactly 1 argument.
Using Racecar 2.2.0 or below works perfectly.
Would it be possible to loosen the arity check, make it optional, or add some kind of workaround so that newer versions of Racecar can be used with the Elastic APM gem?
The text was updated successfully, but these errors were encountered:
Here is the patch that worked well for us, by removing the Arity check:
# frozen_string_literal: true# Racecar# RaceCar has introduced an arity check for the produce & produce_batch methods and enforced it to be = 1.# This, when used along with ElasticAPM::SpanHelper's span_method, is resulting in the arity of -1, which is causing the Racecar Consumers to crash.# This has been logged with Zendesk and until they become lenient with this arity check, the following patch is applied,# to keep our Racecar gem version up to date and use it with Elastic APM.# link for this issue logged with the creators of Racecar: https://github.com/zendesk/racecar/issues/362modulePatchesmoduleRacecarPatchmoduleRacecarAritySkipPatchRacecar::Runner.module_evaldoprivatedefprocess_method@process_method ||= ifprocessor.respond_to?(:process_batch):batchelsifprocessor.respond_to?(:process):singleelseraiseNotImplementedError.new("Consumer class `#{processor.class}` \ must implement a `process` or `process_batch` method")endendendendendendRacecar::Consumer.include(::Patches::RacecarPatch::RacecarAritySkipPatch)
Make sure to require this Patch before the execution of Racecar::Consumer. The better place would be either one of config/initializers/load_patches*.rb or config/application.rb (Just a suggestion)
A strict arity check was added to the
process
method in Racecar in 2.3.0. I believe this check conflicts with the way the NewRelic's Elastic APM gem sets up method spanning.Due to this method signature check, my consumer crashes on start with Racecar 2.3.0 and newer:
Using Racecar 2.2.0 or below works perfectly.
Would it be possible to loosen the arity check, make it optional, or add some kind of workaround so that newer versions of Racecar can be used with the Elastic APM gem?
The text was updated successfully, but these errors were encountered: