I assume a servlet request is kicking off this process? If this is correct
then are you 100% sure that something is not calling the servlet more than
once? Perhaps a retry after a timeout or something?

Turn your access log on and look at what requests are coming in to the
server

Paul


On Tue, Jun 9, 2020 at 2:04 PM Ripu Daman <ripudaman...@gmail.com> wrote:

> Hello everyone,
>
> I work in an IT firm as a software engineer. I don't know whether it's a
> right platform to ask questions based on personal projects but i believe i
> will get some help from here.
>
> We are facing an issue regarding multiple threads being created for a
> servlet execution running in tomcat 9.0.0
>
> Servlet's job is to publish customer leads to salesforce via soap protocol.
> The logic has been designed in such a way that in a single thread it can
> publish multiple leads to salesforce one by one. However we recently
> migrated our java application to kubernetes adopting containerized
> approach.
> Post this we are facing an issue in which, when the process starts
> publishing leads to salesforce one by one, after a few uploads a new thread
> gets created and it starts the whole process from beginning and then after
> a few seconds another thread kicks off repeating the whole process. It
> keeps going on until session timeout exceeds and we get a 504 error. But
> the upload process keeps going on in the background and stops after 2-3
> threads.
>
> Before moving to kubernetes, the process was working fine. In order to
> serve multiple requests at the same time, servlet is not designed to be
> thread safe.
>
> But now we are facing this issue and unable to identify the root cause.
>
> Here's a sample of threads from the logs :
>  [http-nio-8080-exec-9] INFO
>  [http-nio-8080-exec-9] INFO
>  [http-nio-8080-exec-9] INFO
>  [http-nio-8080-exec-7] INFO
>  [http-nio-8080-exec-7] INFO
>  [http-nio-8080-exec-9] INFO
>  [http-nio-8080-exec-9] INFO
>
>  [http-nio-8080-exec-7] INFO
>  [http-nio-8080-exec-7] INFO
>  [http-nio-8080-exec-7] INFO
>  [http-nio-8080-exec-3] INFO
>  [http-nio-8080-exec-7] INFO
>  [http-nio-8080-exec-3] INFO
>
> The configurations for tomcat remains same as default. Session timeout is
> set as 30 min (default).
>
> For more info please let me know.
>
> Hope will get some help from here.
>
> Thanks!
>
> regards,
> Ripu daman
>

Reply via email to