-
Notifications
You must be signed in to change notification settings - Fork 96
Fix circular import #647
base: master
Are you sure you want to change the base?
Fix circular import #647
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
8707c3f
to
d749fb5
Compare
@draffensperger and @hekike what do you think about this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, though I think it's important to comment why this is needed.
@@ -23,6 +23,7 @@ import { | |||
SpanKind, | |||
TraceOptions, | |||
} from '@opencensus/core'; | |||
import 'http'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a comment for why this line is needed to avoid the circular import? And similar for the other case below?
This PR fixes the circular import problems occurring when you load
http2
orhttps
module beforehttp
module.For example, the following code reproduces a problem
@opencensus-instrumentation-http
module doesn't load properly.The process of problem is as follows schematically:
http2
module.require-in-the-middle
load@opencensus-instrumentation-http2
module.@opencensus-instrumentation-http2
load@opencensus-instrumentation-http
module.@opencensus-instrumentation-http
loadhttp
.require-in-the-middle
try to load@opencensus-instrumentation-http
, but loading of@opencensus-instrumentation-http
is already in progress. Therefore require statement return partial@opencensus-instrumentation-http
.