You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by GitBox <gi...@apache.org> on 2022/07/18 04:57:26 UTC

[GitHub] [tomcat] aooohan opened a new pull request, #532: Fixes NPE and Request hang issues in AprEndpoint

aooohan opened a new pull request, #532:
URL: https://github.com/apache/tomcat/pull/532

   See [stackoverflow](https://stackoverflow.com/questions/72975059/tomcat-crashes-while-using-unixdomainsocket-as-a-connector) and #402 
   
   
   8.5.x, 9.0.x, 10.0.x all have this problem.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [tomcat] aooohan commented on pull request #532: Don't perform protection checks in Unix Domain Socket mode

Posted by GitBox <gi...@apache.org>.
aooohan commented on PR #532:
URL: https://github.com/apache/tomcat/pull/532#issuecomment-1189954168

   > The cleanup in NIO is still limited (on purpose): it is only cleaned up if the socket was created successfully by the connector, and it anything fails really badly it will stay there.
   
   Thanks for your reply. Indeed, the cleanup does have limitations. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [tomcat] aooohan commented on pull request #532: Don't perform protection checks in Unix Domain Socket mode

Posted by GitBox <gi...@apache.org>.
aooohan commented on PR #532:
URL: https://github.com/apache/tomcat/pull/532#issuecomment-1189948078

   > > We noticed the the socket file doesn't seem to get cleaned up, despite the documentation indicating it should. As a workaround, we have the systemd unit remove the file after Tomcat stops. We are trying to root cause this in Tomcat code and see if we can figure out whats wrong.
   > 
   > @exabrial I also noticed this problem. I found that the automatic cleaning of UDS file was implemented in NioEndpoint, and I didn't find any logic about it in AprEndpoint.
   
   @exabrial  Aha, i found it! The cleanup function is implemented in tc-native, you can take a look at this
   https://github.com/apache/tomcat-native/blob/a3498fa0992ac37c7358e00d1555395b52762e9b/xdocs/index.xml#L180
   and https://github.com/apache/tomcat-native/commit/a3498fa0992ac37c7358e00d1555395b52762e9b


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [tomcat] markt-asf commented on pull request #532: Don't perform protection checks in Unix Domain Socket mode

Posted by GitBox <gi...@apache.org>.
markt-asf commented on PR #532:
URL: https://github.com/apache/tomcat/pull/532#issuecomment-1201033825

   Note that 8.5.x is not affected by this issue.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [tomcat] markt-asf closed pull request #532: Don't perform protection checks in Unix Domain Socket mode

Posted by GitBox <gi...@apache.org>.
markt-asf closed pull request #532: Don't perform protection checks in Unix Domain Socket mode
URL: https://github.com/apache/tomcat/pull/532


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [tomcat] aooohan commented on pull request #532: Don't perform protection checks in Unix Domain Socket mode

Posted by GitBox <gi...@apache.org>.
aooohan commented on PR #532:
URL: https://github.com/apache/tomcat/pull/532#issuecomment-1189933250

   > We noticed the the socket file doesn't seem to get cleaned up, despite the documentation indicating it should. As a workaround, we have the systemd unit remove the file after Tomcat stops. We are trying to root cause this in Tomcat code and see if we can figure out whats wrong.
   
   @exabrial I also noticed this problem. I found that the automatic cleaning of UDS file was implemented in NioEndpoint, and I didn't find any logic about it in AprEndpoint. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [tomcat] rmaucher commented on pull request #532: Don't perform protection checks in Unix Domain Socket mode

Posted by GitBox <gi...@apache.org>.
rmaucher commented on PR #532:
URL: https://github.com/apache/tomcat/pull/532#issuecomment-1189940447

   The cleanup in NIO is still limited (on purpose): it is only cleaned up if the socket was created successfully by the connector, and it anything fails really badly it will stay there.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [tomcat] exabrial commented on pull request #532: Don't perform protection checks in Unix Domain Socket mode

Posted by GitBox <gi...@apache.org>.
exabrial commented on PR #532:
URL: https://github.com/apache/tomcat/pull/532#issuecomment-1189381572

   Just want to say thanks! Our initial testing shows that bypassing the TCP layer and using Unix sockets is _very significant_ performance increase.... like _a lot_ faster. Pretty danged cool! We'd probably terminate TCP/TLS with Haproxy then load balance to Tomcat listening on Unix sockets.
   
   We still have a few more issues to overcome, but those are separate items or perhaps bugs, for another discussion:
   
   * We noticed the the socket file doesn't seem to get cleaned up, despite the documentation indicating it should. As a workaround, we have the systemd unit remove the file after Tomcat stops. We are trying to root cause this in Tomcat code and see if we can figure out whats wrong.
   * We noticed `request.getRemoteAddr()` and `request.getRemoteHost()` are broken (expected). We improvised a Valve to hardcode `127.0.0.1` for each and that seems to do the trick, then use the RemoteAddrValve to set the real values. A better option might be: Haproxy has something akin to AJP called "Proxy Protocol" that can pass a lot of information from the original request. There's a open bug about it that we might look into helping get across the finish line: https://bz.apache.org/bugzilla/show_bug.cgi?id=57830 
   
   Anyway thank you! Very much appreciated!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [tomcat] aooohan commented on pull request #532: Fixes NPE issues in AprEndpoint

Posted by GitBox <gi...@apache.org>.
aooohan commented on PR #532:
URL: https://github.com/apache/tomcat/pull/532#issuecomment-1186877948

   Personal level is limited, after my deep research, I found that it is not a simple NPE problem, but in Unix Domain Sokcet mode, there is not that OS bug, so there is no need to perform protection checks. I hope my understanding is right, hahahaha


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [tomcat] markt-asf commented on pull request #532: Don't perform protection checks in Unix Domain Socket mode

Posted by GitBox <gi...@apache.org>.
markt-asf commented on PR #532:
URL: https://github.com/apache/tomcat/pull/532#issuecomment-1201031432

   Merged manually. Thanks for the PR.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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