You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Yaniv Sagron <ya...@gmail.com> on 2017/06/21 08:26:43 UTC

TCP (out) connections from webapp gets terminated

Hi,

I have a strange issue with Tomcat 8.5 (and with earlier revisions as well).
I run a Jython interpreter that connects to an external debugger (using
PyDev if it matters to anyone) through a TCP connection.
running the code on a regular Jar or on Jetty works flawlessly (both when
the server is in localhost or on a different machine).
Unfortunately, with Tomcat the connection gets terminate after few
interactions, e.g. stepping Jython instructions or stepping into functions.
Tried it with both, embedded Tomcat in a jar and on a standalone Tomcat
with a war file deployed to it.
Did anyone ever encounter such an issue and can think of a solution or a
way to debug it?

thanks,
Yaniv

Re: TCP (out) connections from webapp gets terminated

Posted by Yaniv Sagron <ya...@gmail.com>.
On Wed, 21 Jun 2017 at 12:18 Mark Thomas <ma...@apache.org> wrote:

> On 21/06/17 09:26, Yaniv Sagron wrote:
> > Hi,
> >
> > I have a strange issue with Tomcat 8.5 (and with earlier revisions as
> well).
> > I run a Jython interpreter that connects to an external debugger (using
> > PyDev if it matters to anyone) through a TCP connection.
> > running the code on a regular Jar or on Jetty works flawlessly (both when
> > the server is in localhost or on a different machine).
> > Unfortunately, with Tomcat the connection gets terminate after few
> > interactions, e.g. stepping Jython instructions or stepping into
> functions.
> > Tried it with both, embedded Tomcat in a jar and on a standalone Tomcat
> > with a war file deployed to it.
> > Did anyone ever encounter such an issue and can think of a solution or a
> > way to debug it?
>
> Tomcat plays no role in outgoing TCP connections or incoming connections
> to sockets it does not control.
>
> Is the connection initiated from the Jython interpreter to the debugger,
> or does the interpreter listen for a connection from the debugger?
>
> I don't think it is a port clash since it would not work at all in that
> case.
>
> I'd probably look at the network traffic in Wireshark to see if there
> are any clues around the time the connection is terminated.
>
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>

Thanks for the reply Mark.

I did use Wireshark and it showed the tcp.fin line but it's hard to tell
what piece of code causes it, especially that it doesn't happen in the
exact same point of the recreation.
The jython interpreter is the client in this case and it initiates the
connection to the debug server. Through this connection it sends stack
data, current instruction, etc. And receives breakpoint info and
instructions from the server.
Strange that it only happens in Tomcat

Re: TCP (out) connections from webapp gets terminated

Posted by Mark Thomas <ma...@apache.org>.
On 21/06/17 09:26, Yaniv Sagron wrote:
> Hi,
> 
> I have a strange issue with Tomcat 8.5 (and with earlier revisions as well).
> I run a Jython interpreter that connects to an external debugger (using
> PyDev if it matters to anyone) through a TCP connection.
> running the code on a regular Jar or on Jetty works flawlessly (both when
> the server is in localhost or on a different machine).
> Unfortunately, with Tomcat the connection gets terminate after few
> interactions, e.g. stepping Jython instructions or stepping into functions.
> Tried it with both, embedded Tomcat in a jar and on a standalone Tomcat
> with a war file deployed to it.
> Did anyone ever encounter such an issue and can think of a solution or a
> way to debug it?

Tomcat plays no role in outgoing TCP connections or incoming connections
to sockets it does not control.

Is the connection initiated from the Jython interpreter to the debugger,
or does the interpreter listen for a connection from the debugger?

I don't think it is a port clash since it would not work at all in that
case.

I'd probably look at the network traffic in Wireshark to see if there
are any clues around the time the connection is terminated.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org