wakatime / sublime-wakatime

Sublime Text 2 & 3 plugin for automatic time tracking and metrics generated from your programming activity.
https://wakatime.com/sublime-text
BSD 3-Clause "New" or "Revised" License
525 stars 47 forks source link

pythonw.exe multiple processes ( too many ) #57

Closed SDiniz closed 8 years ago

SDiniz commented 8 years ago

For the last two days, I've been having an curious problem.

I'm running Sublime Text 2 ( Version 2.0.2, Build 2221 ) on Windows 8.1, and the plugin generates a lot of pythonw.exe processes.

As you can see in the image below.

bug_wakatime_pulign

Don't really know how it suddenly started generating all this processes. The only way to solve it, is to close Sublime, and then re-open it, after a few hours, it's the same again.

alanhamlett commented 8 years ago

Do you have any error messages in your ~/.wakatime.log file? After sending the heartbeat, the process should exit.

SDiniz commented 8 years ago

Yeah, but not errors, only warnings:

{"now": "2015/10/14 22:42:38 GMT Daylight Time", "version": "4.1.8", "plugin": "sublime/2221 sublime-wakatime/5.0.1", "time": 1444858955.265, "level": "WARNING", "message": "C:\Users\Sergio\AppData\Roaming\Sublime Text 2\Packages\WakaTime\packages\wakatime\packages\requests\packages\urllib3\util\ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.\n InsecurePlatformWarning\n"}

{"now": "2015/10/14 22:42:38 GMT Daylight Time", "version": "4.1.8", "plugin": "sublime/2221 sublime-wakatime/5.0.1", "time": 1444858955.728, "level": "WARNING", "message": "C:\Users\Sergio\AppData\Roaming\Sublime Text 2\Packages\WakaTime\packages\wakatime\packages\requests\packages\urllib3\util\ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.\n InsecurePlatformWarning\n"}

And this repeat's forever ( my log file is 44MB right now )

Does this help? Any other thing you need, just ask, no problem at all.

PS: I also use Sublime and Wakatime at home, but at home I don't have any problem, but I'm on windows 7.

alanhamlett commented 8 years ago

Can you enable debug mode in either your Sublime Text Wakatime.sublime-settings file or ~/.wakatime.cfg? Then empty/delete your ~/.wakatime.log file and watch if the heartbeat is getting a successful response code 201 from the api.

Do you need a proxy to connect to the internet at work? That could cause wakatime-cli to wait up to 30 seconds before timing out. However, then those python processes should exit after 30 seconds at the most. It's best to turn on debugging and see where it's getting hung up.

SDiniz commented 8 years ago

So I just enabled debug mode, and deleted the Wakatime log, but I'm already out of the office, tomorrow afternoon ( I'm in Portugal ), I will post the result from the log.

And no, no proxy, but I'm receiving quite a lot of those warnings of slow plugin. I'm also receiving from time to time, the slow plugin error message from Sublime, but I think that is because of the connection to Wakatime servers, not an error about the plugin itself.

alanhamlett commented 8 years ago

You can disable the slow plugin warning, which is an annoyance of ST2 that was fixed in ST3: https://github.com/wakatime/sublime-wakatime/issues/40

I'll wait for the debug logs to shed some light. Talk to you tomorrow!

SDiniz commented 8 years ago

So here is my log, I cropped it a little, so we don't have to look at all of the lines, since the file is already 1.8MB.

https://gist.github.com/SDiniz/6f04ec1af2194148c3a4

Looking at it, I didn't find anything really wrong, some requests return 201 immediately, others take quite some time to return.

Hope this helps.

arleslie commented 8 years ago

Having the same issue randomly. 2015-12-03_11-47-30

{"now": "2015/12/03 11:47:05 Eastern Standard Time", "version": "4.1.8", "plugin": "sublime/3083 sublime-wakatime/6.0.0", "time": 1449161195.592784, "level": "ERROR", "message": "Traceback (most recent call last):\n  File \"C:\\Users\\Andrew Leslie\\AppData\\Roaming\\Sublime Text 3\\Packages\\WakaTime\\packages\\wakatime\\session_cache.py\", line 81, in get\n    c.execute('BEGIN IMMEDIATE')\nsqlite3.OperationalError: database is locked\n"}
{"now": "2015/12/03 11:47:07 Eastern Standard Time", "version": "4.1.8", "plugin": "sublime/3083 sublime-wakatime/6.0.0", "time": 1449161190.730167, "level": "ERROR", "message": "Traceback (most recent call last):\n  File \"C:\\Users\\Andrew Leslie\\AppData\\Roaming\\Sublime Text 3\\Packages\\WakaTime\\packages\\wakatime\\session_cache.py\", line 104, in delete\n    conn, c = self.connect()\n  File \"C:\\Users\\Andrew Leslie\\AppData\\Roaming\\Sublime Text 3\\Packages\\WakaTime\\packages\\wakatime\\session_cache.py\", line 41, in connect\n    ''')\nsqlite3.OperationalError: database is locked\n"}
schleumer commented 8 years ago

I can relate that same bug.

arleslie commented 8 years ago

Possible cause: A plugin (such as wbond's SFTP) has a dialog pop up (the unregistered copy dialog) that isn't closed for a period of time while you're editing.

arleslie commented 8 years ago

Able to reproduce regularly with the above possible cause.

alanhamlett commented 8 years ago

Should be fixed with v7.0.0.