How to check if a web service is running in multiple threads instead of a single one?

我与影子孤独终老i 提交于 2020-01-06 04:46:06

问题


I have a webservice (asmx) that is running on 2 different servers that sit behind a load balancer. The service is called by multiple clients across our organization, as per my current knowledge, none of the clients use multiple threads.

I'm investigating a production issue where some of the data in a few static variables is clearing or returning null or empty, causing db exceptions and foreign key constraint errors.

Upon investigation, I noticed that the singleton pattern is not implemented correctly, so it's definitely not multi thread safe.

I checked with my team and see if there is any scenario where the service might run under multiple threads but they're all saying no.

I don't know why but I'm still convinced that it is running multiple threads as all the production issues I see align with the multi thread functionality. I can also force these errors when I do a parallel.invoke in my unit test cases, but I cannot find the scenario where it's happening on a day to day basis.

I was wondering if there is any way to go through the IIS logs or anything on the windows servers itself that might clarify this situation whether the service or anything inside it is using multiple threads while it's running.

Is it possible that on each IIS, the service is in its own single thread but when it calls other classes and methods within itself, they start their own thread?

I apologize for not sharing any code yet, just given the sheer amount of code, I didn't get a chance to extract part of it to post it here, I'll need to refactor quite a few things before I can post it here.

Many thanks in advance.

来源:https://stackoverflow.com/questions/57162459/how-to-check-if-a-web-service-is-running-in-multiple-threads-instead-of-a-single

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!