Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Input plugin's poll! continues to be invoked after completed? #865

Open
kamituel opened this issue May 16, 2018 · 2 comments
Open

Input plugin's poll! continues to be invoked after completed? #865

kamituel opened this issue May 16, 2018 · 2 comments

Comments

@kamituel
Copy link

When completed? of an input task returns true, it doesn't prevent poll! from being invoked over and over again (quite possibly infinitely).

Here is a repo with a reproduced minimal setup showing this issue: https://github.com/kamituel/onyx-poll-issue.

Steps to reproduce using this repo:

  1. lein run > out.txt
  2. wait some time until job starts
  3. kill it with ctr + c

The output file (out.txt) should have literally thousands of print statements coming from the poll!, and a few coming from completed? that prove it was indeed returning true.

The input plugin is in the onyx-too-many-poll-invocations.jobs.basic namespace.

Reproduced on 0.12.6 and 0.13.0.
Discussed on Gitter on May 17th '18.

@lbradstreet
Copy link
Member

This is fine as long as the plugin knows enough about the source to not do anything on each poll! until the job is determined to be completed. That said, this is a bug, and the task lifecycle should know enough to not poll! an input source if it is completed. I'll get this sorted soon.

@lbradstreet lbradstreet changed the title Input plugin's poll! is being invoked infinitely Input plugin's poll! continues to be invoked after completed? May 28, 2018
@lbradstreet
Copy link
Member

I note that the job eventually completes (albeit after poll! is called a bunch).

I have a proposed fix in #867 which will check whether the plugin returns completed? before poll!'ing for a whole batch. I'm not sure whether the fix is worthwhile as it will come with a performance hit if the plugin's completed? function is expensive.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants