Subclipse vs Autobuild

187 views
Skip to first unread message

Christian Dietrich

unread,
Jul 13, 2017, 11:44:10 AM7/13/17
to Subclipse
We have a Builder run in autobuild that creates new files or deletes inside a folder that is under svn version control
org.tigris.subversion.subclipse.core.status.SynchronizerSyncInfoCache.setCachedSyncBytes(IResource, byte[])
executes a workspace modify operation
org.tigris.subversion.subclipse.core.status.SynchronizerSyncInfoCache.SyncInfoSynchronizedAccessor.internalSetCachedSyncBytes(IResource, byte[])
which leads to the auto build job beeing interrupted

AutoBuildJob.interrupt() line: 188   
BuildManager.interrupt() line: 915   
Workspace.prepareOperation(ISchedulingRule, IProgressMonitor) line: 2186   
Synchronizer.setSyncInfo(QualifiedName, IResource, byte[]) line: 235   
SynchronizerSyncInfoCache$SyncInfoSynchronizedAccessor.internalSetCachedSyncBytes(IResource, byte[]) line: 226   
SynchronizerSyncInfoCache.setCachedSyncBytes(IResource, byte[]) line: 146   
SynchronizerSyncInfoCache.addStatus(IResource, LocalResourceStatus) line: 73   
StatusCacheManager.updateCache(IResource, ISVNStatus) line: 122   
StatusCacheManager.updateCache(IResource, ISVNStatus[]) line: 97   
StatusCacheManager.refreshStatus(IResource, boolean) line: 271   
FileModificationManager.refreshStatusInfinite(Collection<IResource>) line: 218   
FileModificationManager.refreshStatus(IResource[]) line: 257   
FileModificationManager.access$2(FileModificationManager, IResource[]) line: 232   
FileModificationManager$2.run() line: 190   
JobUtility$1$1.run(IProgressMonitor) line: 22   
Workspace.run(ICoreRunnable, ISchedulingRule, int, IProgressMonitor) line: 2240   
Workspace.run(IWorkspaceRunnable, ISchedulingRule, int, IProgressMonitor) line: 2267   
JobUtility$1.run(IProgressMonitor) line: 20   
Worker.run() line: 56  

since our builder is a nice cititzen it respects this interruped
org.eclipse.core.resources.IncrementalProjectBuilder.isInterrupted()
and interrupts the build, stores the state and is later called again.
if it is interruped before building a file completely
(builder produces more than one file)
the same file is built over and over again.

imho subclipse should do nothing as long as build is still running and
thus the code should do something like

canModifyWorkspace = canModifyWorkspace && !org.eclipse.core.resources.ResourcesPlugin.getWorkspace().isAutoBuilding();

Thanks
Christian


Mark Phippard

unread,
Jul 13, 2017, 12:32:42 PM7/13/17
to Christian Dietrich, Subclipse
First off, at this point any changes you want to see in Subclipse are going to require a pull request as we are only maintaining it when we can.

I do not know that it is the case here, but when a file is added or deleted, the Team API triggers the team provider as that is a time when team operations typically need to respond and run.  A very long time ago we added support for a custom SVN property you can set on the root of your project named "DeferFileDelete" that you can set a value of true.  This causes us to ignore certain actions during builders.  The scenario at the time was code generators that would delete files and then regenerate them and the problem showed up as svn delete and svn add running during the build.  That does not sound the same as you are seeing so it might not help at all but would be an easy thing to try.

Mark




Christian


--
You received this message because you are subscribed to the Google Groups "Subclipse" group.
To unsubscribe from this group and stop receiving emails from it, send an email to subclipse+unsubscribe@googlegroups.com.
To post to this group, send email to subc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/subclipse/eddf03f3-5321-4b52-8f96-0b25b2efcf8a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Christian Dietrich

unread,
Jul 14, 2017, 2:17:47 AM7/14/17
to Subclipse
Hello Mark,

the "DeferFileDelete" solves the problem of regenerated files beeing marked as deleted, but i still have the problem that e.g the creation of new files leads to autobuild beeing interrupted via setCachedSyncBytes

we currently try to patch subclipse and detect autobuild running like this

    private boolean isAutobuildRunning() {
        Job[] find = Job.getJobManager().find(ResourcesPlugin.FAMILY_AUTO_BUILD);
        for (Job job : find) {
            if (job.getState() == Job.RUNNING) {
                return true;
            }
        }
        return false;
    }

Hendrik Bünder

unread,
May 15, 2018, 8:45:17 AM5/15/18
to Subclipse
Hi Mark,

its been a while but we tested some different approaches in the meantime. The most promising so far is to enhance the project specific XtextBuilder to not be interupted by the SVN Process. Altough this fixes the problem of our Builder being interupted, it introduces a new problem when the SVN status cache is updated. 

For that problem I found two approaches very interesting.
1. Change the RefreshStatusCacheSchedulingRule in the FileModificationManager, so that it stops whenever another rule is executed. The question here is: Why is the RefreshStatusCacheSchedulingRule  only conflicting with other RefreshStatusCacheSchedulingRule when in fact it causes exceptions when it the status cache update is interupted by other processes? 
2. The approach mentioned by marcgise in https://github.com/subclipse/subclipse/issues/48 --> See detailed questions in the github issue.

I would really like to hear your opinion on the two approaches.

Thanks in advance

Hendrik





Mark Phippard

unread,
May 15, 2018, 9:05:47 AM5/15/18
to Hendrik Bünder, Subclipse
I only have limited amount of time to spend on Subclipse these days so something like this will require others to do the research and submit a pull request.  Hopefully with an explanation of what they found out.

Reply all
Reply to author
Forward
0 new messages