Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Triggers in manual mode hang if event is never emitted #6810

Closed
dlerman2 opened this issue Aug 1, 2023 · 4 comments · Fixed by #9023
Closed

Triggers in manual mode hang if event is never emitted #6810

dlerman2 opened this issue Aug 1, 2023 · 4 comments · Fixed by #9023
Labels
in linear Issue or PR has been created in Linear for internal review

Comments

@dlerman2
Copy link

dlerman2 commented Aug 1, 2023

Describe the bug
For triggers that implement trigger(this: ITriggerFunctions), when you run them in manual mode (eg for testing while building a workflow), they normally run until a single event is emitted and then stop. If you instead click "Stop Listening" in the UI, the app hangs waiting for the single event to come, when instead it should probably call closeFunction() and exit.

To Reproduce

  1. Create a new workflow
  2. Create a Local File Trigger
  3. Select Changes to a specific file and enter any file path
  4. Click Listen for Event
  5. Click Stop Listening
  6. Nothing happens - the workflow hangs waiting for a event

Expected behavior
I expect the trigger to stop listening and go back to edit mode.

Environment (please complete the following information):

  • OS: maxOS 13.5
  • n8n Version [e.g. 1.0.1]: master commit 7832e9c (July 31)
  • Node.js Version [e.g. 18.16.0]: v18.15.0
  • Database system [e.g. SQLite; n8n uses SQLite as default otherwise changed]: Postgres
  • Operation mode [e.g. own; operation modes are own, main and queue. Default is main]: main

Additional context
This seems to be true across multiple Triggers - I just used Local File Trigger because it's easy to test with.

@Joffcom
Copy link
Member

Joffcom commented Aug 1, 2023

Hey @dlerman2,

That is a good find, It looks like the stop button on the left has no impact. If you press the other stop button on the main workflow all is good. I suspect this will be an issue on all of the nodes I added that panel to a few weeks ago, I have created ADO-955 as the internal ticket for this one.

@Joffcom Joffcom added the in linear Issue or PR has been created in Linear for internal review label Aug 1, 2023
@dlerman2
Copy link
Author

dlerman2 commented Aug 1, 2023

Thanks @Joffcom! FYI, for me, it doesn't seem to be tied to the left panel -- if I hit the stop button on the main workflow editor next to "Start Workflow", it hangs with a spinner, and I shut down N8N with ctrl-C, it hangs waiting for the workflow to end.
Screenshot 2023-08-01 at 8 51 36 AM
Screenshot 2023-08-01 at 8 52 51 AM

@Joffcom
Copy link
Member

Joffcom commented Aug 2, 2023

Hey @dlerman2,

That is interesting for me stopping it the other way wored as expected for the nodes I tested with but I am sure we will check this again while fixing it :)

@rthomas6charter
Copy link

Encountered this issue on both RabbitMQ and Kafka Triggers. "Stop Listening" button has no apparent effect. Repeated attempts to click "Stop Execution" eventually hangs portions (e.g. Workflow List) of the UI too. The only way to get things working normally again seemed to be restarting the container.

  • n8n Version: 1.14.2 (containerized)
  • Host OS: macOS Ventura 13.6
  • Docker Desktop Version: 4.10.1 (Docker engine 20.10.17)

top -H output within container (after clicking "stop execution" several times and UI side effects started)

Mem: 17194804K used, 15633676K free, 453552K shrd, 1235940K buff, 5293684K cached
CPU:   6% usr   3% sys   0% nic  89% idle   0% io   0% irq   0% sirq
Load average: 1.60 1.84 1.80 6/2348 73
  PID  PPID USER     STAT   VSZ %VSZ CPU %CPU COMMAND
Mem: 17189620K used, 15638860K free, 453556K shrd, 1235944K buff, 5293948K cached
CPU:   7% usr   3% sys   0% nic  88% idle   0% io   0% irq   0% sirq
Load average: 3.24 2.31 1.97 3/2339 75
  PID  PPID USER     STAT   VSZ %VSZ CPU %CPU COMMAND
    7     1 node     S    8762m  26%   2   0% node /usr/local/bin/n8n
   11     1 node     S    8762m  26%   2   0% node /usr/local/bin/n8n
   12     1 node     S    8762m  26%   0   0% node /usr/local/bin/n8n
    9     1 node     S    8762m  26%   1   0% node /usr/local/bin/n8n
   10     1 node     S    8762m  26%   4   0% node /usr/local/bin/n8n
   29     1 node     S    8762m  26%   3   0% node /usr/local/bin/n8n
   15     1 node     S    8762m  26%   1   0% node /usr/local/bin/n8n
   14     1 node     S    8762m  26%   3   0% node /usr/local/bin/n8n
   17     1 node     S    8762m  26%   4   0% node /usr/local/bin/n8n
   16     1 node     S    8762m  26%   1   0% node /usr/local/bin/n8n
   13     1 node     S    8762m  26%   4   0% node /usr/local/bin/n8n
    8     1 node     S    8762m  26%   2   0% node /usr/local/bin/n8n
   46     0 node     S     1804   0%   1   0% sh
   36     0 node     S     1804   0%   2   0% sh
   56     0 node     S     1804   0%   3   0% sh
   65     0 node     S     1776   0%   4   0% sh
   75    65 node     R     1704   0%   2   0% top -H
    1     0 node     S      828   0%   0   0% tini -- /docker-entrypoint.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in linear Issue or PR has been created in Linear for internal review
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants