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

EventHandlerPlugin - On Cancel, PrintFailed event incorrectly firing before PrintCancelled #1836

Closed
fraschetti opened this issue Mar 25, 2017 · 2 comments
Labels
bug Issue describes a bug done Done but not yet released

Comments

@fraschetti
Copy link

fraschetti commented Mar 25, 2017

What were you doing?

Canceled a print and observed the order of events sent to on_event for the EventHandlerPlugin I'm developing.

What did you expect to happen and what happened instead?

Per the documentation and comments on the issue below, I would expect PrintCancelled to occur first then PrintFailed. It is possible to differentiate a Failed event that was triggered via a Cancel if the Cancel occurs first but if the Fail occurs first, it's difficult (without buffering events and waiting) to dismiss the Failed event (assuming that's what is intended)
#1170

Actually the design is that both events fire. A cancelled print is also a failed print. First it fires the PrintCancelled event then the PrintFailed event leaving your LEDs red.

To elaborate on this a bit more: The idea is that if you cancel a print, it obviously failed, so both events fire. There also might be another reason for the print to fail however (e.g. a communication loss during the print), so there are two separate events. In a nutshell: if you see a PrintCancelled event in your plugin, ignore the PrintFailed event that follows.

It looks like depending on what command the printer is executing, the Cancelled event may come in immediately after the Failed event or it may come in much later. e.g. if the printer is responding to a command to warm a nozzle and the print is cancelled, the Failed event occurs immediately but the Cancelled event may be waiting until the command completed on the printer?

Branch & Commit or Version of OctoPrint

Observed in both:
OctoPrint 1.3.1 (master branch)
OctoPrint 1.3.2 (master branch)

Operating System running OctoPrint

OctoPi 0.13

Printer model & used firmware incl. version

Original Prusa i3 MK2
Marlin V1.0.2; Sprinter/grbl mashup for gen6

Browser and Version of Browser, Operating System running Browser

N/A

Link to octoprint.log

https://gist.github.com/fraschetti/18ea4bbb0783627b5fa1297d0a284a8b

Link to contents of terminal tab or serial.log

https://gist.github.com/fraschetti/5d96c9b70d6c7f1d7ab8af53fe44654f

Link to contents of Javascript console in the browser

N/A

Screenshot(s) or video(s) showing the problem:

N/A

I have read the FAQ.

@GitIssueBot
Copy link

Hi @fraschetti,

It looks like there is some information missing from your bug report that will be needed in order to solve the problem. Read the Contribution Guidelines which will provide you with a template to fill out here so that your bug report is ready to be investigated (I promise I'll go away then too!).

If you did not intend to report a bug but wanted to request a feature or brain storm about some kind of development, please take special note of the title format to use as described in the Contribution Guidelines.

Please do not abuse the bug tracker as a support forum - if you have a question or otherwise need some kind of help or support refer to the Mailinglist or the G+ Community instead of here.

Also make sure you are at the right place - this is the bug tracker of the official version of OctoPrint, not the Raspberry Pi image OctoPi nor any unbundled third party OctoPrint plugins or unofficial versions. Make sure too that you have read through the Frequently Asked Questions and searched the existing tickets for your problem - try multiple search terms please.

I'm marking this one now as needing some more information. Please understand that if you do not provide that information within the next two weeks (until 2017-04-08 18:00 UTC) I'll close this ticket so it doesn't clutter the bug tracker. This is nothing personal, so please just be considerate and help the maintainers solve this problem quickly by following the guidelines linked above. Remember, the less time the devs have to spend running after information on tickets, the more time they have to actually solve problems and add awesome new features. Thank you!

Best regards,
~ Your friendly GitIssueBot

PS: I'm just an automated script, not a human being, so don't expect any replies from me :) Your ticket is read by humans too, I'm just not one of them.

@GitIssueBot GitIssueBot added incomplete Issue template has not been fully filled out, no further processing until fixed triage This issue needs triage and removed incomplete Issue template has not been fully filled out, no further processing until fixed labels Mar 25, 2017
@foosel
Copy link
Member

foosel commented Mar 27, 2017

That was actually a bug... A while ago some refactoring took place to fix another issue and that messed up the order in which the events were fired. That should now be as stated in the quoted ticket again on maintenance, soon on devel and will be released this way with 1.3.3

Thanks for reporting! (that also applies to the other ticket for course :))

@foosel foosel added done Done but not yet released bug Issue describes a bug and removed triage This issue needs triage labels Mar 27, 2017
@foosel foosel added this to the 1.3.3 milestone Mar 27, 2017
@foosel foosel closed this as completed in 01ad9b8 May 31, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue describes a bug done Done but not yet released
Projects
None yet
Development

No branches or pull requests

3 participants