Skip to content

Possible NRE fix#91

Merged
Aaronontheweb merged 2 commits intopetabridge:devfrom
IgorFedchenko:nre-possible-fix
Nov 18, 2019
Merged

Possible NRE fix#91
Aaronontheweb merged 2 commits intopetabridge:devfrom
IgorFedchenko:nre-possible-fix

Conversation

@IgorFedchenko
Copy link
Contributor

Close #90

Not sure if this is related, but due to ConcurrentDictionary.AddOrUpdate specific internal hashset could be populated with some threading issues.

Other way could be to just throw away Parallel.ForEach here, but... Lets try this update first.

P.S. NRE is caused by the fact that some of the elements of this hashset is null. Each element is taken directly from projectFile, which not be null by itself (it is created just before passing to FindProjectImports method, and used several times before adding it to hashset).
So, the only weak place is adding to hashset, and since updateValueFactory is executed by ConcurrentDictionary without thread lock, this may give some issues. Do not see relation with NRE, but this is only place I can fix here.

@Aaronontheweb
Copy link
Member

That makes sense - an immutability problem. Well, using an immutable value for this if we're modifying its contents concurrently makes sense. Let's give that a try.

@Aaronontheweb Aaronontheweb merged commit 92753e5 into petabridge:dev Nov 18, 2019
@IgorFedchenko IgorFedchenko deleted the nre-possible-fix branch January 11, 2020 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: NRE during Incrementalist.ProjectSystem.Cmds.FilterAffectedProjectFilesCmd

2 participants