Before the provider manager accepts requests, it starts classProvider and interopProvider. interopProvider makes upcalls which hit classProvider, so a 2 second sleep allows classProvider enough time to initialize before handling requests. Instead of a sleep, we can use a semaphore to indicate when a provider has finished initializing. This will be both faster and more accurate. Additionally, httpAdapter shouldn't be sending any requests to providerMgr until interopProvider finishes initializing; we can have a similar solution for that.
Log in to post a comment.