UPDATE 10/02/2013:
WHEW!!! What a roller-coaster the last few days. All kinds of bugs and reversions popped up, so the test explorers have been kind of screwy the last few days.
Fixed:
I finally tracked down the exact cause of the thread delay and lockup during a large ledger requests. I had been looking at the wrong part of the server function. The problem was not the threads themselves, but the database connection(s). The persistent database connection appeared to solve the issue, but caused many other issues that made me lose more hair off my already bald head.
It was causing major problems with the dbloader, and the whole of CCE3 went sideways for a bit.
I found the solution within Cherrypy itself (It is amazing how flexible this framework is!!). The web server now issues each thread its own database connection upon creation and closes the connection upon thread closing. No more sessions (cookies on the client end, the entire session tool is disabled) or persistent database connections. CCE3 is back to being the light, efficient application I wanted it to be.
The last major explorer issue is redirecting requests during a orphan database rebuild. I could take the easy way out and set a default error page that states the explorer is rebuilding its database and to try the request again in a few minutes, but that seems kind of a messy way to do it as it would go to that page regardless of the error. However, in the interest of getting the time table back on track, I may have to go that route and patch a more elegant solution after release.
API:
API solution is next on the table. The developers message box access is going to be included in the API as it seems the appropriate place for it.
The API is going to be a separate module from the web server. I feel this is the best way to do this for two reasons.
The API module can be streamlined into handling JSON request/response and Long Polling without all the HTML baggage.
When the need arises I can shut down web services and API services separately as needed. Since other sites depend on the API, if there is a problem with a web server, hopefully I can keep the API up while working on the web server issue. This of course works both ways, no need to take down the web server for an API issue.
Work on the API will begin tonight or tomorrow.
If things go smooth
I can see release being on time in the middle of this month.