Message11490
Further investigation shown that this issue is due to using compiled re objects in multi-threading environment. Using the script below one can reproduce errors saying that certain attributes not present in org.python.modules.sre.MatchObject. This errors are not reproducible for jython2.7.0!
---- Then the question is -- should re be thread-safe at all?
import thread
import re
import time
REGEX = re.compile('((?:foo|bar)+)(\d*)E?')
def parse(line):
m = REGEX.search(line)
if m.groups():
print m.group(1)
thread.start_new_thread(parse, ('foobarfoofoofoofoofoofoofoofoofoofoo234',))
thread.start_new_thread(parse, ('foobarbarbarbarbarbarbarbarbarbarfoo4E',))
thread.start_new_thread(parse, ('foofoofoofoofoofoofoofoofoofoofoofoo434',))
thread.start_new_thread(parse, ('barbarbarbarbarbarbarbarbarfoofoo4',))
thread.start_new_thread(parse, ('foobarbarbarbarbarbarbarfoofoofoofoofoofoofoobarfoo4',))
thread.start_new_thread(parse, ('foobarbarbarbarbarbarbarbarbarfoo3424',))
thread.start_new_thread(parse, ('foofoobarfoobarfoobarfoobarfoobar333334E',))
thread.start_new_thread(parse, ('barfoofoo4barfoofoobarfoofoo4barfoofoo4barfoofoo4barfoofoo4',))
thread.start_new_thread(parse, ('foofoofoobarbarfoofoobarbarfoofoobarbarfoofoobarbar4',))
thread.start_new_thread(parse, ('foobarbarbarbarbarbarbarfoofoofoofoofoofoofoobarfoo4',))
thread.start_new_thread(parse, ('foobarbarbarbarbarbarbarbarbarfoo3424',))
thread.start_new_thread(parse, ('foofoobarfoobarfoobarfoobarfoobar333334E',))
thread.start_new_thread(parse, ('barfoofoo4barfoofoobarfoofoo4barfoofoo4barfoofoo4barfoofoo4',))
thread.start_new_thread(parse, ('foofoofoobarbarfoofoobarbarfoofoobarbarfoofoobarbar4',))
time.sleep(1) |
|
Date |
User |
Action |
Args |
2017-07-21 17:01:39 | Ivan | set | messageid: <1500656499.05.0.0579039833714.issue2609@psf.upfronthosting.co.za> |
2017-07-21 17:01:39 | Ivan | set | recipients:
+ Ivan |
2017-07-21 17:01:38 | Ivan | link | issue2609 messages |
2017-07-21 17:01:38 | Ivan | create | |
|