Multiple synchroniseEnd events while indexing git repository [message #1815106] |
Wed, 25 September 2019 09:35  |
Eclipse User |
|
|
|
Expected behaviour:
Have a git respository. HEAD-1 has one file. Add a new file to the repository, commit.
After indexing a git repository via:
final Git gitVcs = new Git();
gitVcs.init(gitPath.toString(), indexer);
gitVcs.run();
indexer.addVCSManager(gitVcs, persist);
and registering for a GraphChangeListener, the synchroniseEnd event is fired once.
Observed behavior:
The new file is indexed multiple times, and thus multiple synchroniseEnd events are received. The following is printed multiple times in the console
updating indexer:
Loading: file:/C:/git/secondFile
different revisions, resetting check timer and propagating changes!
Comments
From this it would seem that the initial indexing did not actually propagate and that the file is no registered as indexed and that is why it is indexed multiple times? Is there some additional operation on the indexer that must be called to persist the changes in the DB?
The DB files look as to be modified the same day as the code is run, so it would seem the DB is being modified.
I would like to know when the indexing finished (asynchronously) and receiving multiple events for the same call is not ideal.
|
|
|
Re: Multiple synchroniseEnd events while indexing git repository [message #1815177 is a reply to message #1815106] |
Thu, 26 September 2019 15:25   |
Eclipse User |
|
|
|
Did you disable periodic checks? By default, Hawk will re-check and re-synchronise itself periodically with the monitored location. "synchroniseEnd" simply means that the synchronisation process ended, which may as well have not found any changes.
That message ("different revisions, resetting check timer and propagating changes!") is normal: Hawk is simply saying that it found changes, so it will reset its re-synchronisation timer to the minimum value. Hawk uses an exponential backoff policy: first it will check for changes after X seconds, then if no changes are found it will wait X*2 seconds, and it will keep doubling that up to a maximum value whenever no changes are found. If a change is found, it will reset the timer back to X seconds.
Have you tried running the query "return Model.allInstances.size;" and checking that it returns a non-zero value? If that is the case, then it is indexing the model. As mentioned above, Hawk is simply notifying you that the synchronisation process completed, not that there were any changes.
At the moment, the Git component pretty much works as the LocalFolder component, by looking at the files in the folder: it does not really use the actual Git history. It simply ignores the contents of any .git folder. We have an issue pending on switching it to JGit to really access past history:
https://github.com/mondo-project/mondo-hawk/issues/79
[Updated on: Thu, 26 September 2019 15:29] by Moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03431 seconds