Community
Participate
Working Groups
Inernally the QueuedBuildData uses a Map<String, LinkedList<URI>> to store individual queues for all projects. When queueURI(URI) is called the URI is added to the list of the respective project (as determined by the IStorage2UriMapper). But the project queue is a simple LinkedList and it is not checked whether the queue already contains the given URI. This can cause the builder to build a resource twice. This can for instance happen if the build is cancelled during the second build phase. By then the URIs will already have been queued (part of first build phase). The next build will queue the same URIs again. This problem could also arise with an unusual IStorage2UriMapper implementation or an unusual project where URIs are mapped multiple times into the project using linked folders.
Thinking about it I think it is wrong that the builder queues URIs which later don't get removed if the build gets canceled. This means that the next build will build these resources again. Use case: The user makes a change to a source and hits save. As a result the builder queues and starts building many resources because he made a "real" change. The user now realizes that he did something wrong and cancels the build. Next he reverts the change and hits save again. The builder will again start building all those resources, even though that's not required anymore. Now the user has to restart Eclipse if he doesn't want to go through with the build. Raising importance to major. Please revert to normal in case I missed something. Also note that this is related to the initially reported problem but not quite the same.
Not sure I understand the importance here. The worst thing that can possibly happen is that resources are built twice? I guess you are concerned about build time? Feel free to come up with a fix of the problem if it's that important for you.
Actually the worst case is worse: The JDT could queue some deltas and the next build invocation would then queue the corresponding affected resource URIs. If now this build (or a build of another project) is cancelled after already having dequeued one of these URIs, then the corresponding resources will never be rebuilt. The QueuedBuildData should be transactional: - URIs queued during a build (except those queued in response to pending deltas!) should be removed from the queue if the build is cancelled. - URIs dequeued during the build should be enqueued again if the build is cancelled.
Please feel free to provide a patch for the described problem.
Not 2.1
Looks like this was fixed in Xtext 2.8.0 by https://github.com/eclipse/xtext/commit/ab5cba98cbd62018e3c8198e3f62daecb8294b3f . Close issue?
Thanks for the book-keeping.
Requested via bug 522520. -M.