[modules-dev] [Fwd: [Fwd: Review request: 6563535, URLRepository.install]]

Dave Bristor David.Bristor at Sun.COM
Wed Aug 15 20:22:23 PDT 2007


Stanley M. Ho wrote:
> 
> Looks good. One last nitpick ;-)
> 
>  733             contents.remove(mai);
>  794                 // Restore previous state
>  795                 contents.put(mai, md);
>  803                 contents.put(mai, md);
> 
> You might want to apply similar logic here - mai should be removed from 
> the contents only after the JAM file has been uninstalled and the 
> metadata has been updated successfully.

I thought about that too, but: In the install case we discussed earlier, it's 
a Bad Thing if a thread calls Repository.list() during installation, it could 
see a ModuleArchiveInfo for a JAM that's not fully installed yet (or worse, 
might fail to install).

So in the uninstall case, I left it in reverse: while one thread is 
uninstalling a module, another thread calling Repository.list() would see only 
those ModuleArchiveInfos for installed modules that are not in the process of 
being uninstalled.  At least that's the intent: should I reverse it as you 
suggest?

With both install and uninstall, there are small windows of opportunity for 
this behavior to not hold, since list() is not synchronized.

Thanks,
	Dave


> 
> - Stanley



More information about the modules-dev mailing list