E&S CVS Commit: PEAK - Fixed several 'peak.events' bugs, as reported by Vladimir Iliev, Yaroslav

pje at eby-sarna.com pje at eby-sarna.com
Thu Sep 23 17:08:00 EDT 2004


Module Name:	PEAK
Committed By:	pje
Date:		Thu Sep 23 21:07:44 UTC 2004

Modified Files:
	PEAK: CHANGES.txt
	PEAK/src/peak/events: io_events.py sources.py twisted_support.py
	PEAK/src/peak/events/tests: test_events.py

Log Message:
Fixed several 'peak.events' bugs, as reported by Vladimir Iliev, Yaroslav
Samchuk, and Alexander Smishlajev:

* 'events.AnyOf' could hold multiple references to a single event source,
  and nesting 'AnyOf()' calls could leak references to the nested events.

* 'events.subscribe()' had a potential race condition wherein a callback
  could be invoked after its weak reference was garbage collected, leading
  to bizarre error messages about 'self' being 'None'.

* 'select()' could be called on select event objects even if there were
  no current subscribers to the event, potentially leading to calling
  'select()' on a closed socket.

* Non-default signal handlers were remaining installed even when there
  were no current subscribers to the applicable event, as long as a
  reference to the event object existed.

As a result of these changes, certain I/O event types (esp. signals and
stream readable/writeable events) are now longer-lived.  For example,
signal event objects are now immortal, and the read/write event for a
particular 'fileno()' will be reused for as long as its supplying
'Selector' or 'EventLoop' instance exists.  (Previously, weak references
were used so that these objects would be recycled when not in use.)


To view diffs of this commit, you can use the following URL(s):
http://cvs.eby-sarna.com/PEAK/CHANGES.txt.diff?r1=1.144&r2=1.145
http://cvs.eby-sarna.com/PEAK/src/peak/events/io_events.py.diff?r1=1.10&r2=1.11
http://cvs.eby-sarna.com/PEAK/src/peak/events/twisted_support.py.diff?r1=1.10&r2=1.11
http://cvs.eby-sarna.com/PEAK/src/peak/events/sources.py.diff?r1=1.13&r2=1.14
http://cvs.eby-sarna.com/PEAK/src/peak/events/tests/test_events.py.diff?r1=1.15&r2=1.16

To generate a diff of this commit:
cvs rdiff -r1.144 -r1.145 PEAK/CHANGES.txt
cvs rdiff -r1.10 -r1.11 PEAK/src/peak/events/io_events.py \
    PEAK/src/peak/events/twisted_support.py
cvs rdiff -r1.13 -r1.14 PEAK/src/peak/events/sources.py
cvs rdiff -r1.15 -r1.16 PEAK/src/peak/events/tests/test_events.py

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




More information about the source-changes mailing list