Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 319380 - Back to Back provisioning operations can lead to a closed backup store
Summary: Back to Back provisioning operations can lead to a closed backup store
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.7 M1   Edit
Assignee: Ian Bull CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-09 09:02 EDT by Ian Bull CLA
Modified: 2010-07-11 09:44 EDT (History)
2 users (show)

See Also:
simon_kaegi: review+


Attachments
fix v1 (1.55 KB, patch)
2010-07-09 09:58 EDT, Ian Bull CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Bull CLA 2010-07-09 09:02:11 EDT
When doing two provisioning operations in a row, I get the following exception (on the second operation):

org.eclipse.equinox.internal.p2.touchpoint.natives.ClosedBackupStoreException: Can not perform restore on closed backup store
	at org.eclipse.equinox.internal.p2.touchpoint.natives.BackupStore.restore(BackupStore.java:406)
	at org.eclipse.equinox.internal.p2.touchpoint.natives.LazyBackupStore.restore(LazyBackupStore.java:53)
	at org.eclipse.equinox.internal.p2.touchpoint.natives.NativeTouchpoint.rollback(NativeTouchpoint.java:108)
	at org.eclipse.equinox.internal.p2.engine.EngineSession.rollback(EngineSession.java:194)
	at org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine.java:82)
	at org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine.java:44)
	at org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine.java:48)
	
After some digging, I know what's going on.

1. The first operation creates a backup store and then eventually discards it (in the commit)
2. However, the backup store is cached in a weak hash map (static) in NativeTouchpoint
3. The next operation needs to use the store, and it finds the cached one
4. It grabs it, and tries to use the store
5. Boom... already closed.

I think we need to clear the backup store cache during the commit.

I'll put a patch together.
Comment 1 Ian Bull CLA 2010-07-09 09:58:23 EDT
Created attachment 173862 [details]
fix v1

This clears the profile state stored in the native touchpoint during the commit.
Comment 2 Ian Bull CLA 2010-07-11 09:44:24 EDT
I've released this to head. What do you think of this for 3.6.1?  It's pretty safe since all we're doing is proactively clearing a weak hash map when we're done with it.