Closed M0rtalW0mbat closed 8 years ago
Thanks for the detailed report! I'll have a look shortly :)
Ok, I think I've found the problem - if I publish a new version do you have time to try it out?
Yep, give me a couple of days
https://pypi.python.org/pypi/seqlog/0.3.0 It was really fast, i try check it tomorrow :) Thx!
Now its hard to repeat, but i got it, see on screenshot in attach. As you can see i use VSCode debugger for simulate this situation(simply jump over breakpoints), maybe this is important....
Hmm, when i run this script in cmd shell, some messages is lost, in seq srv i see only two of them.
Somethimes only one of them:
My test script: InstallationsProcessing.zip
Ok thanks - that gives me something to work with; I'll have a look at it first thing tomorrow.
Sorry for the inconvenience:-/
On 17 Nov. 2016, at 7:18 pm, M0rtalW0mbat notifications@github.com wrote:
My test script: InstallationsProcessing.zip
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub, or mute the thread.
Apparently this can also happen if server returns an empty response. I'll try your script when I get home.
Ok, this is weird - I'm running your test script but I cannot reproduce the problem :-/ I've run it 15-20 times and it may pause occasionally while flushing the log but never seems to crash.
I'm on Python 3.4.4 on OSX, though, so I'll try running this on my Surface when I get home and see if that makes a difference...
Some log entries going missing, BTW, is usually because the process exits before the queue can be fully flushed. I added a sleep at the end of your script and all your log entries then show up.
I'll see if I can do something about those lost events though - losing log entries during a crash is kinda poor behaviour...
In the meanwhile, what if you just add a sleep(1)
to the end of your test script. Do you still get the error?
Ok, sleep solve message losing, but it is not related with Exception and original problem :)
I try run script in VSCode debugger again twice and on second try i catch same situation like earlier.
One more hint: i use VSCode debugger implemented by plugin(Python plugin by Don Jayamanne). I forgot to mention this earlier.
No worries - I'm going to try this on my Windows machine when I get home tomorrow. Thanks for sticking with this, we'll work it out eventually :)
Yep, good luck with this :) I was glad to help
BTW, if you want to automatically flush log, you can do something like:
import atexit
import logging
atexit.register(logging.shutdown) # Will flush and close all log handlers when the app exits
This salvation need some support from the inside of library :) Some check if consumer is running, maybe
D:\workspace\AnalyticsProcessing>python InstallationsProcessing.py
Seqlog version: 0.3.0
aaaaaaaaaa
bbbbbbbbbbbbbbb
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "C:\Users\Михаил\AppData\Local\Programs\Python\Python35\lib\logging\__init__.py", line 1882, in shutdown
h.close()
File "C:\Users\Михаил\AppData\Local\Programs\Python\Python35\lib\site-packages\seqlog\structured_logging.py", line 332, in close
self.consumer.stop()
File "C:\Users\Михаил\AppData\Local\Programs\Python\Python35\lib\site-packages\seqlog\consumer.py", line 90, in stop
raise Exception("The consumer is not running.")
Exception: The consumer is not running.
Cheers - found and fixed that bug already, just haven’t built a new package yet :)
On 17 Nov 2016, at 9:38 PM, M0rtalW0mbat notifications@github.com wrote:
D:\workspace\AnalyticsProcessing>python InstallationsProcessing.py Seqlog version: 0.3.0 aaaaaaaaaa bbbbbbbbbbbbbbb Error in atexit._run_exitfuncs: Traceback (most recent call last): File "C:\Users\Михаил\AppData\Local\Programs\Python\Python35\lib\logginginit.py", line 1882, in shutdown h.close() File "C:\Users\Михаил\AppData\Local\Programs\Python\Python35\lib\site-packages\seqlog\structured_logging.py", line 332, in close self.consumer.stop() File "C:\Users\Михаил\AppData\Local\Programs\Python\Python35\lib\site-packages\seqlog\consumer.py", line 90, in stop raise Exception("The consumer is not running.") Exception: The consumer is not running. — You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/tintoy/seqlog/issues/1#issuecomment-261213577, or mute the thread https://github.com/notifications/unsubscribe-auth/ABkezLth1dxx0bfqB5eNO_WPNwhstNx9ks5q_C65gaJpZM4KzP71.
Ok this is getting weird - have tried the latest code on Windows and still can't reproduce the error:
I'll try it from VS Code, next, to see if that makes a difference. When you run it from VS Code, are you running it with the debugger attached, or just using VS Code to launch it?
It works from VS Code, too:
I'm going to try publishing a new package with all the changes I made yesterday and today, let's see if that makes a difference for you.
When you run it from VS Code, are you running it with the debugger attached, or just using VS Code to launch it?
Yes, Im just using VS Code (just press F5). But without breakpoints its don't crash. Breakpoints is very important :)
Interesting - I did set breakpoints but only in the seqlog code. Where did you set yours again? Sorry on mobile so images not coming through...
On 18 Nov. 2016, at 2:52 pm, M0rtalW0mbat notifications@github.com wrote:
When you run it from VS Code, are you running it with the debugger attached, or just using VS Code to launch it? Yes, Im just using VS Code, but without breakpoints its don't crash. Breakpoints is very important :)
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub, or mute the thread.
first: seqlog.set_global_log_properties(Application='13') second: print('aaaaaaaaaa') third: print('bbbbbbbbbbbbbbb')
Script crush after third breakpoint in most cases
Ok! I've managed to reproduce the problem (seems to only happen on VS Code in Windows) - I'll have a poke-around and see what I can find.
seems to only happen on VS Code in Windows
Im lucky :)
Looks good, i can't reproduce crash on version 0.3.3. I think we can close this issue. Great job! :)
Glad to hear it :)
Description
This simple example somethimes fire exception:
Exception