Skip to content

Conversation

Furgas
Copy link
Contributor

@Furgas Furgas commented Sep 16, 2018

If an exception will be thrown when provisioning the class instance, the
injector won't clear the inProgressMake flag for this class, causing
cyclic dependency exception when the instance for this class will be
requested again.

@Danack
Copy link
Collaborator

Danack commented Sep 16, 2018

Could do us a favour and run the benchmarks for performance on this change and against master on a non-shared machine?

The reason I didn't fix this originally was I was scared of a slow down by having another try/catch in a hot code path. The performance report in the travis ci build.......show making this change makes the code faster which is :spocks_eyebrow.gif:

@Furgas
Copy link
Contributor Author

Furgas commented Sep 17, 2018

I find these benchmark quite useless - results sometimes vary vastly on consecutive runs.
Nevertheless, here you are:
https://gist.github.com/Furgas/d57d0658de87aff74e078623105841c7

Can also be of use:
https://gist.github.com/Furgas/d19ca419969337a341b58a3d6eb7b9ce

@kelunik
Copy link
Collaborator

kelunik commented Feb 10, 2019

I intend to merge this, regardless of any performance benchmark, because it's a bug that should be fixed.

We could probably move the code inside make into an internal doMake method, so we only have one try / catch around the top-most make instead of every nested make.

@Danack @trowski Opinions?

@trowski
Copy link

trowski commented Feb 10, 2019

I've found benchmarks on Travis to be dubious at best, the try/catch is definitely slower, but not enough that it's even worth discussing.

As for an internal doMake function, maybe it's something to look at when I (or someone else) migrates this lib to 7.1+.

@Furgas Furgas force-pushed the fix-for-exception-when-provisioning branch from 580ea41 to 610b81c Compare February 11, 2019 17:16
If an exception will be thrown when provisioning the class instance, the
injector won't clear the inProgressMake flag for this class, causing
cyclic dependency exception when the instance for this class will be
requested again.
@kelunik kelunik merged commit 4fd6032 into rdlowrey:master Feb 18, 2019
@Furgas Furgas deleted the fix-for-exception-when-provisioning branch February 18, 2019 18:32
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.

5 participants