techfromsage / tripod-php

Object Graph Mapper for managing RDF data in Mongo
MIT License
29 stars 4 forks source link

PLT-244 Fix Tripod Resque event listeners #146

Closed mrliptontea closed 10 months ago

mrliptontea commented 10 months ago

An error was seen in production:

PHP Fatal error:  Uncaught Error: Call to undefined method RisImportJob::errorLog() in /var/rl-app/vendor/talis/tripod-php/src/mongo/base/JobBase.class.php:107

This was caused by the fact that Tripod's JobBase class' constructor registers Resque onFailure event listener, so it's possible that this function will get called by a non-tripod worker in case of an error.

Two possible fixes:

  1. (Currently implemented, non-breaking) make sure event listeners ignore calls for jobs that don't inherit JobBase.
  2. (Breaking) Remove JobBase constructor, and move the responsibility for registering listeners to library's consumer.