Skip to content
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

Lot of changes from Joy Team #2

Open
wants to merge 48 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
fcf02da
Bugfix: WSGIServer connection hangs on unconsumed POST data
amlinux Jun 26, 2010
366ecac
Pyx fixes to compile on Debian Lenny
amlinux Oct 16, 2010
c505df3
Debian package descriptions
amlinux Oct 16, 2010
712d6e2
HTTP client timeouts and responses without length
amlinux Oct 16, 2010
30e6cb4
HTTP server must consume all input
amlinux Oct 16, 2010
7e0d35d
Version switch to 0.3.2
amlinux Oct 16, 2010
1aa987e
Debian fixes
amlinux Oct 16, 2010
5e14e4f
HTTP 204 No Content - processing correctly
amlinux Oct 16, 2010
e12b039
Deferred evaluation of chunks
amlinux Oct 23, 2010
b52487c
Debian version
amlinux Oct 23, 2010
ad365c6
SMTP client
amlinux Oct 30, 2010
e5ef45a
Thrift support
amlinux Oct 30, 2010
a4ee710
Debian release
amlinux Oct 30, 2010
47886fe
Debian changes
amlinux Nov 6, 2010
af769a4
Asynchronous DNS client (based on python-adns)
amlinux Nov 6, 2010
ffdc83b
engine.run() removed
amlinux Nov 6, 2010
ef4f4e2
DNS run cycle terminated when no requests pending
amlinux Nov 6, 2010
847750b
Bugfix
amlinux Nov 6, 2010
7e6e37c
Debian fixes
amlinux Nov 6, 2010
9ff672f
MySQL: long packets support
amlinux Sep 30, 2012
ad91844
memcached: handle exceptions during flush
amlinux Sep 30, 2012
91508d8
gitignore: swp files added
amlinux Sep 30, 2012
722fc89
http server: HEAD support
amlinux Sep 30, 2012
4773606
CompatibleFile: better follow python protocol
amlinux Sep 30, 2012
87ff930
debian: packaging info updated
amlinux Sep 30, 2012
cc3d4e9
BuferredReader: some corner cases fixed
amlinux Sep 30, 2012
680e43f
Makefile: test environment fixed
amlinux Sep 30, 2012
430a3ac
debian: added some gitignores
amlinux Sep 30, 2012
3e16eb8
makefile: support for simple use cases like "make test"
amlinux Sep 30, 2012
c067073
concurrence.event.pyx: MAJOR RACE CONDITION FIXED
amlinux Sep 30, 2012
c8ce147
memcached test: do not touch 11211 port
amlinux Sep 30, 2012
0814a6c
unittests: a bit less verbose
amlinux Sep 30, 2012
d7f755f
BaseExceptions are not caught anymore
amlinux Sep 30, 2012
0e95738
Debian changelog updated
amlinux Sep 30, 2012
d7cacf3
mysql.client fix: set connection state to STATE_ERROR after any excep…
nikicat Nov 11, 2010
391dbd1
memcache: survive after connection failures
amlinux Sep 30, 2012
f7ec313
Debian changelog
amlinux Sep 30, 2012
50fc4a1
Correctly handle requests interrupted by client when sending request …
amlinux Oct 27, 2012
1db8af8
Debian packaging
amlinux Oct 27, 2012
cec2225
mysql: fix logging
amlinux Jun 26, 2013
bf8abc2
mysql: allow close connection is other states
amlinux Jun 26, 2013
760279b
mysql: do not log errors that are raised as exceptions
amlinux Jul 30, 2013
5b4927f
mysql: keep connection after ClientCommandError
amlinux Jul 30, 2013
5d4da3c
mysql: sandbox test
amlinux Jul 30, 2013
b8f7abe
Additional scenarios in MySQL sandbox
amlinux Aug 3, 2013
89abcf1
Daemons are not excluded from tasklets hierarchy
amlinux Aug 3, 2013
1db1572
Children of destroyed tasklets are adopted by their grantparents
amlinux Aug 3, 2013
c4d1e4f
Debian changelog
amlinux Aug 3, 2013
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@ build
tmp
*.dep
.settings
*.egg
lib/concurrence/http/concurrence.http._http.c
lib/concurrence/concurrence._event14.c
concurrence.egg-info
debian/concurrence
*.swp
31 changes: 24 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
CWD=$(shell pwd)
ifndef PYTHON
export PYTHON=python2.6
endif
ifndef DESTDIR
export DESTDIR=$(CWD)/debian/tmp
endif
export PYTHONPATH=/usr/share/pyshared:$(DESTDIR)/usr/lib/$(PYTHON)

.PHONY: test install doc

build:
$(PYTHON) setup.py build

Expand All @@ -7,19 +18,18 @@ ext:
egg:
$(PYTHON) setup.py bdist_egg

install:
$(PYTHON) setup.py install
install: build
mkdir -p $(DESTDIR)/usr/lib/$(PYTHON)
$(PYTHON) setup.py install --prefix=$(DESTDIR)/usr --install-purelib=$(DESTDIR)/usr/lib/$(PYTHON) --install-platlib=$(DESTDIR)/usr/lib/$(PYTHON) --install-layout=deb --root=/

sdist:
$(PYTHON) setup.py sdist

_doc:
doc:
rm -rf doc/html
cd doc/src; make html
cp -a doc/src/_build/html doc/html

doc: _doc

clean:
-find . -name *.pyc -exec rm -rf {} \;
-find . -name *.so -exec rm -rf {} \;
Expand All @@ -38,10 +48,17 @@ clean:
dist_clean: clean
find . -name .svn -exec rm -rf {} \;

_test:
test: install
cd test; make test

test: _test
test-test: install
$(PYTHON) test/testtest.py

test-core: install
$(PYTHON) test/testcore.py

test-memcache: install
$(PYTHON) test/testmemcache.py

coverage:
cd test; coverage erase
Expand Down
3 changes: 3 additions & 0 deletions debian/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.log
*.substvars
/files
187 changes: 187 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
concurrence (0.3.2-26) unstable; urgency=low

* Children of destroyed parents are adopted by grandparents

-- Alexander Lourier <[email protected]> Sat, 03 Aug 2013 23:11:44 +0400

concurrence (0.3.2-25) unstable; urgency=low

* Daemons are not excluded from tasklets hierarchy

-- Alexander Lourier <[email protected]> Sat, 03 Aug 2013 21:52:44 +0400

concurrence (0.3.2-24) unstable; urgency=low

* MySQL: less verbose logging
* MySQL: keep connection after ClientCommandError

-- Alexander Lourier <[email protected]> Tue, 30 Jul 2013 17:22:26 +0400

concurrence (0.3.2-23) unstable; urgency=low

* Allow to close MySQL connection in other states

-- Alexander Lourier <[email protected]> Wed, 26 Jun 2013 13:52:15 +0400

concurrence (0.3.2-22) unstable; urgency=low

* MySQL logging fixed

-- Alexander Lourier <[email protected]> Wed, 26 Jun 2013 12:39:49 +0400

concurrence (0.3.2-21) unstable; urgency=low

* Correctly handle requests interrupted by client when sending request body

-- Alexander Lourier <[email protected]> Sun, 28 Oct 2012 01:42:04 +0400

concurrence (0.3.2-20) unstable; urgency=low

* Memcached: survive after connection loss

-- Alexander Lourier <[email protected]> Mon, 01 Oct 2012 01:17:03 +0400

concurrence (0.3.2-19) unstable; urgency=low

* Memcached: handle exceptions during flush
* HEAD support for HTTP Server
* CompatibileFile fixes
* BufferedReader: corner case bugfixes
* Test environment enhancements
* Major race condition in concurrence core fixed
* BaseExceptions are not handled anymore

-- Alexander Lourier <[email protected]> Sun, 30 Sep 2012 19:34:19 +0400

concurrence (0.3.2-18) unstable; urgency=low

* MySQL RLE encoding support for 253 code

-- Alexander Lourier <[email protected]> Thu, 22 Mar 2012 12:03:09 +0400

concurrence (0.3.2-17) unstable; urgency=low

* Error handling in Memcached module

-- Alexander Lourier <[email protected]> Wed, 14 Dec 2011 10:08:29 +0400

concurrence (0.3.2-16) unstable; urgency=low

* HEAD method support
* 502 Not Implemented response to any not known method

-- Alexander Lourier <[email protected]> Mon, 05 Sep 2011 14:33:20 +0400

concurrence (0.3.2-15) unstable; urgency=low

* WSGIInputStream.readline() now accepts parameter maxlen=-1 (does nothing although)

-- Alexander Lourier <[email protected]> Mon, 15 Aug 2011 13:59:17 +0400

concurrence (0.3.2-14) unstable; urgency=low

* readline() now accepts parameter maxlen=-1 (does nothing although)

-- Alexander Lourier <[email protected]> Mon, 15 Aug 2011 13:55:53 +0400

concurrence (0.3.2-13) unstable; urgency=low

* Moving to squeeze

-- Alexander Lourier <[email protected]> Sun, 13 Feb 2011 22:19:34 +0300

concurrence (0.3.2-12) unstable; urgency=low

* Bugfix with ADNS

-- Alexander Lourier <[email protected]> Sun, 07 Nov 2010 00:32:55 +0300

concurrence (0.3.2-11) unstable; urgency=low

* ADNS support

-- Alexander Lourier <[email protected]> Sat, 06 Nov 2010 20:23:53 +0300

concurrence (0.3.2-10) unstable; urgency=low

* Thrift and SMTP implementation

-- Alexander Lourier <[email protected]> Sat, 30 Oct 2010 10:38:57 +0400

concurrence (0.3.2-9) unstable; urgency=low

* Deferred evaluation of chunks

-- Alexander Lourier <[email protected]> Sun, 24 Oct 2010 01:56:14 +0400

concurrence (0.3.2-8) unstable; urgency=low

* Minor changes

-- Alexander Lourier <[email protected]> Sat, 23 Oct 2010 01:34:17 +0400

concurrence (0.3.2-6) unstable; urgency=low

* Size and time limits on HTTP client downloads

-- Alexander Lourier <[email protected]> Thu, 09 Sep 2010 16:14:35 +0400

concurrence (0.3.2-5) unstable; urgency=low

* Fixed bug with readline buffer size

-- Alexander Lourier <[email protected]> Thu, 09 Sep 2010 14:51:32 +0400

concurrence (0.3.2-4) unstable; urgency=low

* libevent dependency

-- Alexander Lourier <[email protected]> Fri, 06 Aug 2010 13:54:01 +0400

concurrence (0.3.2-2) unstable; urgency=low

* WSGIInputStream.readline implemented

-- Alexander Lourier <[email protected]> Wed, 04 Aug 2010 17:24:40 +0400

concurrence (0.3.2-1) unstable; urgency=low

* New upstream release

-- Alexander Lourier <[email protected]> Fri, 04 Jun 2010 19:46:52 +0400

concurrence (0.3.1-6) unstable; urgency=low

* python-webob added to dependencies

-- Alexander Lourier <[email protected]> Tue, 01 Jun 2010 18:08:50 +0400

concurrence (0.3.1-5) unstable; urgency=low

* python-routes added to dependencies

-- Alexander Lourier <[email protected]> Tue, 01 Jun 2010 17:57:25 +0400

concurrence (0.3.1-4) unstable; urgency=low

* Library paths fixed

-- Alexander Lourier <[email protected]> Tue, 01 Jun 2010 16:01:15 +0400

concurrence (0.3.1-3) unstable; urgency=low

* Disabled pysupport

-- Alexander Lourier <[email protected]> Tue, 01 Jun 2010 13:10:17 +0400

concurrence (0.3.1-2) unstable; urgency=low

* fixed install dir

-- Alexander Lourier <[email protected]> Sat, 27 Mar 2010 21:15:46 +0300

concurrence (0.3.1-1) unstable; urgency=low

* Initial release

-- Alexander Lourier <[email protected]> Sat, 27 Mar 2010 19:24:28 +0300
1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7
18 changes: 18 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Source: concurrence
Section: python
Priority: optional
Maintainer: Alexander Lourier <[email protected]>
Build-Depends: debhelper (>= 7), python2.6-minimal (>= 2.6.stackless-1), libevent-dev (>= 1.4), python-pyrex, python2.6-dev (>= 2.6.stackless-1)
Standards-Version: 3.8.3
Homepage: http://opensource.hyves.org/concurrence/

Package: concurrence
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, python2.6-minimal (>= 2.6.stackless-1), libevent-1.4-2, ${python:Depends}
Recommends: python-routes, python-webob
Description: Framework for creating massively concurrent network applications in Python.
It takes a Lightweight-tasks-with-message-passing approach to concurrency.
The goal of Concurrence is to provide an easier programming model for writing
high performance network applications than existing solutions (Multi-threading,
Twisted, asyncore etc). Concurrence uses Lightweight tasks in combination with
libevent to expose a high-level synchronous API to low-level asynchronous IO.
27 changes: 27 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright (C) 2009, Hyves (Startphone Ltd.)
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of Hyves (Startphone Ltd.) nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3 changes: 3 additions & 0 deletions debian/docs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
README
TEST.TXT
doc/
17 changes: 17 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export PYTHON=python2.6
export DEB_BUILD_OPTIONS="nocheck"

%:
#dh --without=python-support $@
dh $@
6 changes: 3 additions & 3 deletions lib/concurrence/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# This module is part of the Concurrence Framework and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
__version__ = '0.3.1' #remember to update setup.py
__version__ = '0.3.2' #remember to update setup.py
__version_info__ = tuple([ int(num) for num in __version__.split('.')])

from concurrence.core import dispatch, quit, disable_threading, get_version_info, TIMEOUT_NEVER, TIMEOUT_CURRENT
Expand All @@ -16,10 +16,10 @@

try:
import json
except:
except Exception:
try:
import simplejson as json
except:
except Exception:
import logging
logging.exception("could not import json library!', pls install simplejson or use python 2.6+")

12 changes: 7 additions & 5 deletions lib/concurrence/_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ def interceptor(addr):


class TestCase(unittest.TestCase):
def setUp(self):
logging.debug("setUp %s, %s", self, '; '.join(['%s: %s' % (k, v) for k, v in get_version_info().items()]))
#def setUp(self):
# logging.debug("setUp %s, %s", self, '; '.join(['%s: %s' % (k, v) for k, v in get_version_info().items()]))

def tearDown(self):
try:
Tasklet.yield_() #this make sure that everything gets a change to exit before we start the next test
logging.debug("tearDown %s, tasklet count #%d", self, Tasklet.count())
except:
#logging.debug("tearDown %s, tasklet count #%d", self, Tasklet.count())
except Exception:
pass

class _Timer:
Expand All @@ -83,13 +83,15 @@ def sec(self, n):
def timer():
return _Timer()

def main(timeout = None):
def main(timeout = None, ontimeout = None):

logging.basicConfig()
logging.root.setLevel(logging.DEBUG)

if timeout is not None:
def quit_test():
if ontimeout:
ontimeout()
logging.error("quiting unittest on timeout")
quit(EXIT_CODE_TIMEOUT)
logging.debug("test will timeout in %s seconds", timeout)
Expand Down
2 changes: 1 addition & 1 deletion lib/concurrence/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def start(self):
for _, resource, fa, member in self._find_members(r'__start(\d\d)__'):
try:
level = int(fa[0])
except:
except Exception:
level = -1

if level != -1:
Expand Down
Loading