artisan-roaster-scope / artisan

artisan: visual scope for coffee roasters
https://artisan-scope.org
GNU General Public License v3.0
907 stars 252 forks source link

"Too many open files" after few runs #533

Closed aqdennis closed 3 years ago

aqdennis commented 3 years ago

Expected Behavior

Save my profile

Actual Behavior

Profile is not saved, message "Exception filesave(): [Errno: 24] Too many open files @line 26484

Steps to Reproduce the Problem

  1. Do a roast, save the profile afterwards
  2. Reset, load last saved profile as background for new roast and do a new roast
  3. Repeat 3 times, saving profile after roast no longer possible

Specifications

Please attach your current Artisan settings file (as exported via menu Help >> Save Settings as .aset) file. Please attach any relevant Artisan .alog profiles.

Note that you need either add a .txt extension or zip the files before uploading. Otherwise you will receive a "Not a supported file type" error on uploading.

MAKOMO commented 3 years ago

See Issue #523

MAKOMO commented 3 years ago

Fixed in the v2.4.4 Release Candidate available here: https://github.com/artisan-roaster-scope/artisan/releases/tag/v2.4.4

aqdennis commented 3 years ago

I am using 2.4.4.....downloaded yesterday.

On Sun, 6 Dec 2020, 12:42 Marko Luther, notifications@github.com wrote:

Fixed in the v2.4.4 Release Candidate available here: https://github.com/artisan-roaster-scope/artisan/releases/tag/v2.4.4

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/artisan-roaster-scope/artisan/issues/533#issuecomment-739490735, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALOKCIKN7XXDJ3U6LJ6JZKTSTNU2JANCNFSM4UPICXJA .

MAKOMO commented 3 years ago

Hm. This is bad news. Could you connect and run a few minutes and attach here your serial log (menu Help >> Serial, you need to tick the flag in that dialog to start logging)?

Thanks, Marko

aqdennis commented 3 years ago

Here you are, just logging warming up the machine and a completed roast with the mentioned error.

serial_log_2.txt serial_log.txt

If you need something else, just let me know...

Dennis

MAKOMO commented 3 years ago

Something does not fit together. Your settings attached above were written with Artisan v2.4.2 not v2.4.4. Your serial_logs indicate that Artisan is sending too many requests to the machine which Artisan v2.4.4 is not doing using your attached settings. Im puzzled. Could you please attach again the settings as exported from Artisan v2.4.4?

Anyhow, could you please deselect "Oversampling" (menu Config) and in the S7 port settings (menu Config >> Port, 4th tab both flags, "optimize" and "fetch full blocks". This should resolve the issue for you.

aqdennis commented 3 years ago

Ah, I yesterday updated from 2.4.2 to 2.4.4 but I just read the old settings file, never saved the settings from within 2.4.4. That might explain the mismatch in version number. Will change the config as you mention...thanks!

Dennis.

On Sun, 6 Dec 2020, 17:24 Marko Luther, notifications@github.com wrote:

Something does not fit together. Your settings attached above were written with Artisan v2.4.2 not v2.4.4. Your serial_logs indicate that Artisan is sending too many requests to the machine which Artisan v2.4.4 is not doing using your attached settings. Im puzzled. Could you please attach again the settings as exported from Artisan v2.4.4?

Anyhow, could you please deselect "Oversampling" (menu Config) and in the S7 port settings (menu Config >> Port, 4th tab both flags, "optimize" and "fetch full blocks". This should resolve the issue for you.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/artisan-roaster-scope/artisan/issues/533#issuecomment-739526041, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALOKCIOAJEMD7JMNUBL53HLSTOV2JANCNFSM4UPICXJA .

aqdennis commented 3 years ago

Deselecting Optimize (Fetch full blocks was already deselected) actually has the opposite effect: after a 10-12 minutes I get an S7 communiication error again. So right now I have Optimize back on but Oversampling off. I have attached another serial log for your information.

Dennis serial_log_3.txt

MAKOMO commented 3 years ago

Sorry I was in a hurry and did not write my sentence fully. You should turn off Oversampling and both flags, optimize and fetch full blocks on. That should resolve your issue.

MAKOMO commented 3 years ago

If this does not help you need to switch to a 2sec sampling rate. Some Giesen PLCs are too slow and are not able to answer too many requests.

MAKOMO commented 3 years ago

Could you send me also the message and error log of a period the issue happens (menu Help >> Errors, Messages). Thanks.

MAKOMO commented 3 years ago

Dennis,

this one is mystic to me as I don't get a clear picture of what the machine returns (or not), what the real issue here is (I assume that the machine get's more requests than it can handle and that it terminates some of the connections, something that on the Artisan side might not be recognized because Artisan uses a separate C-lib for this communication) and I have no machine to test myself. I did apply some modification on the Siemens S7 that ensure that there is only one request per 0.03sec sent to the machine (kind of a random value, but quite moderate and corresponding to MODBUS standards over serial lines) and to better handle the case of terminated connections.

I would love if you could test the new build on your setup from here as this is blocking now the v2.4.4 final release:

https://github.com/artisan-roaster-scope/artisan/releases/tag/continuous

Thanks, Marko

aqdennis commented 3 years ago

Dear Marko,

I still have to roast tonight (Christmas madness here) so I will test it. Any log file you would like me to generate an send back? Should I switch on oversampling again?

Cheers, Dennis

On Tue, 8 Dec 2020, 18:50 Marko Luther, notifications@github.com wrote:

Dennis,

this one is mystic to me as I don't get a clear picture of what the machine returns (or not), what the real issue here is (I assume that the machine get's more requests than it can handle and that it terminates some of the connections, something that on the Artisan side might not be recognized because Artisan uses a separate C-lib for this communication) and I have no machine to test myself. I did apply some modification on the Siemens S7 that ensure that there is only one request per 0.03sec sent to the machine (kind of a random value, but quite moderate and corresponding to MODBUS standards over serial lines) and to better handle the case of terminated connections.

I would love if you could test the new build on your setup from here as this is blocking now the v2.4.4 final release:

https://github.com/artisan-roaster-scope/artisan/releases/tag/continuous

Thanks, Marko

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/artisan-roaster-scope/artisan/issues/533#issuecomment-740796859, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALOKCIKALKJUNXPCQQBJRNTSTZRPDANCNFSM4UPICXJA .

MAKOMO commented 3 years ago

Dannis, excellent timing (of course bad for you with all that work;). Please keep the oversampling off (this is not productive)( and best to keep both those flags (optimizer and full blocks) under Port ticked as this minimizes the number of requests send to the machine.

If things go north again, please send me all three logs the error, message and serial log (you need to tick that flag in the serial log before starting the session).

Thanks for your support, Marko

aqdennis commented 3 years ago

Hi Marko,

First the good news .... I let it sample for the full warm up (35 minutes) and did 2 roasts and no problems. I check the logs and no errors.... I wrote a small program to check how fast I can sample the Giesen. I used Snap7 library under FreePascal and used Cli_ReadMultiVars to sample all 8 values in 1 go. Taking 100 samples with 10 ms interval was no problem. I had hoped of course to find that that was too fast....

The only strange thing now is that the first roast didn't give me statistics or a summary afterwards. When I clicked on the area where it should appear I got an error message. I have attached the message and the profile...

The only difference I can think of is that for the first roast I filled in some roast properties before the actual roast whereas for the 2nd roast I didn't, I filled in the roast properties afterwards. Probably it has nothing to do with it...

Cheers, Dennis

On Tue, 8 Dec 2020 at 19:10, Marko Luther notifications@github.com wrote:

Dannis, excellent timing (of course bad for you with all that work;). Please keep the oversampling off (this is not productive)( and best to keep both those flags (optimizer and full blocks) under Port ticked as this minimizes the number of requests send to the machine.

If things go north again, please send me all three logs the error, message and serial log (you need to tick that flag in the serial log before starting the session).

Thanks for your support, Marko

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/artisan-roaster-scope/artisan/issues/533#issuecomment-740810251, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALOKCILP7BPZG42RGJBXGKTSTZTYJANCNFSM4UPICXJA .

Chiapas_6000_08-12-2020-2.alog.txt error-4.png.txt

MAKOMO commented 3 years ago

On 8. Dec 2020, at 22:11, aqdennis notifications@github.com wrote:

Hi Marko,

First the good news .... I let it sample for the full warm up (35 minutes) and did 2 roasts and no problems. I check the logs and no errors....

This is good news.

I wrote a small program to check how fast I can sample the Giesen. I used Snap7 library under FreePascal and used Cli_ReadMultiVars to sample all 8 values in 1 go. Taking 100 samples with 10 ms interval was no problem. I had hoped of course to find that that was too fast....

Thanks for testing this. So my limit of 30ms should be fine.

The only strange thing now is that the first roast didn't give me statistics or a summary afterwards.

Not sure what you mean by this.

When I clicked on the area where it should appear I got an error message. I have attached the message and the profile...

Nothing attached. Could you send me both to check?

The only difference I can think of is that for the first roast I filled in some roast properties before the actual roast whereas for the 2nd roast I didn't, I filled in the roast properties afterwards. Probably it has nothing to do with it...

Could have to do something with it. Maybe something you entered could not be rendered. Send me the screenshot and the profile and I will check and please keep an eye on the communication thing.

Thanks, Marko

Cheers, Dennis

On Tue, 8 Dec 2020 at 19:10, Marko Luther notifications@github.com wrote:

Dannis, excellent timing (of course bad for you with all that work;). Please keep the oversampling off (this is not productive)( and best to keep both those flags (optimizer and full blocks) under Port ticked as this minimizes the number of requests send to the machine.

If things go north again, please send me all three logs the error, message and serial log (you need to tick that flag in the serial log before starting the session).

Thanks for your support, Marko

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/artisan-roaster-scope/artisan/issues/533#issuecomment-740810251, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALOKCILP7BPZG42RGJBXGKTSTZTYJANCNFSM4UPICXJA .

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.

MAKOMO commented 3 years ago

Note that you can attache files here (on the Github tracker) by drag-and-drop.

aqdennis commented 3 years ago

Hi,

This is the profile. Just found out I didn't copy the screenshot to the cloud so it's still on the laptop in the roastery.

But if you would read the profile it doesn't give the horizontal bar with the 3 phases and the time/RoR/development per phase at the top of the graph and neither the white summary area with the AUC on the right. When right-clicking on the x-axis the axis label first gets the roast title added, but when right-clicking again it does not give the advanced information but an error message instead. I can send you the screenshot tomorrow...

Cheers, Dennis

On Tue, 8 Dec 2020, 22:22 Marko Luther, notifications@github.com wrote:

On 8. Dec 2020, at 22:11, aqdennis notifications@github.com wrote:

Hi Marko,

First the good news .... I let it sample for the full warm up (35 minutes) and did 2 roasts and no problems. I check the logs and no errors....

This is good news.

I wrote a small program to check how fast I can sample the Giesen. I used Snap7 library under FreePascal and used Cli_ReadMultiVars to sample all 8 values in 1 go. Taking 100 samples with 10 ms interval was no problem. I had hoped of course to find that that was too fast....

Thanks for testing this. So my limit of 30ms should be fine.

The only strange thing now is that the first roast didn't give me statistics or a summary afterwards.

Not sure what you mean by this.

When I clicked on the area where it should appear I got an error message. I have attached the message and the profile...

Nothing attached. Could you send me both to check?

The only difference I can think of is that for the first roast I filled in some roast properties before the actual roast whereas for the 2nd roast I didn't, I filled in the roast properties afterwards. Probably it has nothing to do with it...

Could have to do something with it. Maybe something you entered could not be rendered. Send me the screenshot and the profile and I will check and please keep an eye on the communication thing.

Thanks, Marko

Cheers, Dennis

On Tue, 8 Dec 2020 at 19:10, Marko Luther notifications@github.com wrote:

Dannis, excellent timing (of course bad for you with all that work;). Please keep the oversampling off (this is not productive)( and best to keep both those flags (optimizer and full blocks) under Port ticked as this minimizes the number of requests send to the machine.

If things go north again, please send me all three logs the error, message and serial log (you need to tick that flag in the serial log before starting the session).

Thanks for your support, Marko

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/artisan-roaster-scope/artisan/issues/533#issuecomment-740810251 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ALOKCILP7BPZG42RGJBXGKTSTZTYJANCNFSM4UPICXJA

.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/artisan-roaster-scope/artisan/issues/533#issuecomment-741053300, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALOKCIPUX5KF5ARZQATIQ7LST2KKHANCNFSM4UPICXJA .

Chiapas_6000_08-12-2020-2.alog.txt error-4.png.txt

MAKOMO commented 3 years ago

Sorry nothing attached! You need to go to Github at https://github.com/artisan-roaster-scope/artisan/issues/533#issuecomment-741150466 and drag-and-drop it to the comment window at the very end of this page and press Comment. The Email that is send by the Tracker can be used to answer, but only for Text. Attachments are removed.

aqdennis commented 3 years ago

Attached them to my earlier messages ....

MAKOMO commented 3 years ago

Thanks a lot for this. Just fixed this. This is a long standing issue occurring only if the DROP event not being set. Thanks for all your support. I will close this one and release v2.4.4.