feed-me
feed-me copied to clipboard
FeedMe job are not actually cancelled when released via the Queue Manager or via Feed Me settings
Description
When I "release" a Feed Me job in the Queue Manager, it says it is cancelled - and removes it from the craft_queue DB table - but the job keeps running (Feed Me keeps logging, and the number of CMS entries it creates keeps increasing).
Steps to reproduce
- Start an import by clicking "Run feed" from the Feed Me plugin. The feed I'm running is a JSON feed of store locations mapping to entries with 8 fields, all of which are Plain Text.
- Go to the queue manager and click "Release all jobs". Or go to admin/feed-me/settings/general and click "Clear pending job queue"
- Go to Feed Me logs and notice that it is still processing nodes.
- Go to the entries list of the type you are importing from the feed. Notice that the number of entries keeps growing after a refresh
Additional info
-
Craft CMS version: Pro 3.5.15.1
-
Feed Me version: 4.3.1
-
PHP version: 7.3.31
-
Database driver & version: MySQL 8.0.26
-
Other plugins & versions: Amazon S3 1.2.11, Entry Instructions 1.0.7, Freeform 3.9.1, Imager v2.4.0, Incognito Field 1.2.0, Neo 2.8.14, Reasons 2.2.2, Redactor 2.8.3, Sprout SEO 4.6.5, Stamp 2.1.0, Workflow 1.5.6
-
I also have a custom plugin that is hooking into Craft's
Elements::EVENT_BEFORE_SAVE_ELEMENT
event so that every time a store location entry is saved by Feed Me, a latitude and longitude lookup is done based on address field and added as two more fields to the entry.
I have exactly the same issue, @beckysolomon can you tell me if the feed jobs you had problems with are paginated? I think for normal feeds its fine, I only had problems with the jobs that were triggered by the pagination offset, so the starting page is still able to be canceled, but as soon as the feed has started its first offset, you cant stop it anymore.
BTW: We also have custom logic that hooks into a few events, for example Process::EVENT_STEP_BEFORE_ELEMENT_SAVE
@AUYT I do not have pagination. I do also have custom logic hooked into EVENT_STEP_BEFORE_ELEMENT_SAVE
Any news on this?
Whether releasing jobs via the queue manager or canceling from Feed Me, neither will kill any currently running jobs, only jobs that haven’t started yet.
php-fpm (or however PHP is running) has already kicked off a process that can’t easily be killed directly from PHP without exec
'ing out to a shell, running a bunch of ps
and grep
commands trying to find the exact process the queue is running as and kill
ing it, which isn’t something we want to do.
I guess this could be improved in Feed Me by not using the word “cancel," which implies it will work for running, too.
Thanks for the answer! Then it's up to us to find a faster way to find and kill the process running the job(s).