-
Notifications
You must be signed in to change notification settings - Fork 303
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
It was the cronserver mgmt command all along #3152
It was the cronserver mgmt command all along #3152
Conversation
cronserver gunks up the works for the other kaserve command. Not clear to me why. I'm calling not executing it a workaround. Does it actually do anything? Also, fixed a bug in the 'status' command. Windows doesn't like an HTTPConnection with "0.0.0.0" address.
Excellent debugging! We can't just skip starting up the cronserver, though -- it's used to auto-sync data in the background every hour, which is important. Do you think it's an issue with spawning the thread? Where exactly does it freeze up? Possible alternative solution, if we can't get the thread spawning working, is to modify the Windows GUI to:
|
It doesn't freeze up, so much as a second thread with the exact same command is run (so for example, if I execute |
I'm not really any closer to understanding this issue. I'm not throwing in the towel, but I'm making an open call for help/insight. |
For some reason, the thread running the cronserver management command (in Windows only) barfs and kills the whole process. This prevents the server from starting. Why does it get sick and die? Who knows? A better solution on windows (better than trying to UNIX-ly daemonize programs) seems to be to create windows services. Then kalitectl.py can simply start and stop those services. Just to be clear, there's no issue on windows with running the cronserver and kaserve command in separate processes (say, in different instances of cmd.exe or using subprocess.Popen), there's only an issue when they are run in different threads belonging to the same process.
My commit message, for posterity: |
thread = ManageThread(command, args=args, name=" ".join([command]+args)) | ||
thread.start() | ||
else: | ||
Popen([sys.executable, os.path.abspath(sys.argv[0]), "manage", command] + args, creationflags=CREATE_NEW_PROCESS_GROUP) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@EdDixon I think we can merge this if you tell us that the |
Merging this. @EdDixon please test this tomorrow in the bug bash. |
It was the cronserver mgmt command all along
@@ -219,7 +222,7 @@ def get_pid(): | |||
listen_port = getattr(settings, "CHERRYPY_PORT", LISTEN_PORT) | |||
|
|||
# Timeout is 1 second, we don't want the status command to be slow | |||
conn = httplib.HTTPConnection(LISTEN_ADDRESS, listen_port, timeout=3) | |||
conn = httplib.HTTPConnection("127.0.0.1", listen_port, timeout=3) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Nice getting this fixed!! I think it's problematic that kalite is using "0.0.0.0" and not a deliberate IP-address. It isn't normal precisely because of the reason we've just seen. It would be more "normal" (as per my personal experience with linux apps) to default to "127.0.0.1", furthermore to allow binding to multiple addresses, including "0.0.0.0" which could be deliberately set on a system that supports it. Further... it reminds of the need to get Celery #2891 |
cronserver gunks up the works for the other kaserve command.
Not clear to me why. I'm calling not executing it a workaround.
Does it actually do anything?
Also, fixed a bug in the 'status' command. Windows doesn't like
an HTTPConnection with "0.0.0.0" address.
This provisionally addressed #2919, but I think we need to look more closely at why the cronserver management command is causing these issues on Windows.
kalite.bat start/stop/status
all work in this state, though. Sad me is getting slightly less sad. :|