SeattleTestbed / attic

ARCHIVAL: Full mirror of SeattleTestbed's SVN in early 2014. We use GitHub since!
MIT License
0 stars 1 forks source link

Repyhelper cache corruption on SeattleOnAndroid #1125

Open choksi81 opened 10 years ago

choksi81 commented 10 years ago

On SeattleOnAndroid it happens that pycryptorsa_repy.py and sockettimeout_repy.py have zero bytes, crashing the software updater (see below). I speculate this happens due to a race condition of the softwareupdater starting, building the cache (slowly, it's running on a phone!), but not appearing active to our GUI, which then restarts the softwareupdater --- bang!

(Judging from #617, this might be worth investigating on slow/low-end/highly loaded machines in general.)

I suggest to add a clause checking for empty (but properly named) files, recreating them as required. Checking for the suspected race in the SeattleOnAndroid GUI is also required.

localhost seattle_repy # python softwareupdater.py
dlopen libpython2.6.so
dlopen /system/lib/libc.so
Traceback (most recent call last):
  File "softwareupdater.py", line 64, in <module>
    repyhelper.translate_and_import("signeddata.repy")
  File "/mnt/sdcard/sl4a/seattle/seattle_repy/repyhelper.py", line 458, in translate_and_import
    _import_file_contents_to_caller_namespace(modulename, preserve_globals)
  File "/mnt/sdcard/sl4a/seattle/seattle_repy/repyhelper.py", line 491, in _import_file_contents_to_caller_namespace
    import_module = __import__(modulename)
  File "softwareupdater.repyhelpercache/signeddata_repy.py", line 51, in <module>
    repyhelper.translate_and_import('rsa.repy')
  File "/mnt/sdcard/sl4a/seattle/seattle_repy/repyhelper.py", line 458, in translate_and_import
    _import_file_contents_to_caller_namespace(modulename, preserve_globals)
  File "/mnt/sdcard/sl4a/seattle/seattle_repy/repyhelper.py", line 491, in _import_file_contents_to_caller_namespace
    import_module = __import__(modulename)
  File "softwareupdater.repyhelpercache/rsa_repy.py", line 42, in <module>
    repyhelper.translate_and_import('pycryptorsa.repy')
  File "/mnt/sdcard/sl4a/seattle/seattle_repy/repyhelper.py", line 457, in translate_and_import
    modulename = translate(filename, shared_mycontext, callfunc, callargs, force_overwrite)
  File "/mnt/sdcard/sl4a/seattle/seattle_repy/repyhelper.py", line 407, in translate
    if force_overwrite or _translation_is_needed(filenamewithpath, generatedfilenamewithpath):
  File "/mnt/sdcard/sl4a/seattle/seattle_repy/repyhelper.py", line 198, in _translation_is_needed
    raise TranslationError("File name exists but wasn't automatically generated: " + generatedfile)
repyhelper.TranslationError: File name exists but wasn't automatically generated: softwareupdater.repyhelpercache/pycryptorsa_repy.py

localhost seattle_repy #
choksi81 commented 10 years ago

Author: justinc Moshe: this seems like it may be up your alley. Can you fix it?