You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2022/10/18 17:07:46 UTC

[GitHub] [trafficcontrol] srijeet0406 opened a new pull request, #7146: Better messages for Traffic Router exceptions

srijeet0406 opened a new pull request, #7146:
URL: https://github.com/apache/trafficcontrol/pull/7146

   <!--
   Thank you for contributing! Please be sure to read our contribution guidelines: https://github.com/apache/trafficcontrol/blob/master/CONTRIBUTING.md
   If this closes or relates to an existing issue, please reference it using one of the following:
   
   Closes: #7081 
   Related: #ISSUE
   
   If this PR fixes a security vulnerability, DO NOT submit! Instead, contact
   the Apache Traffic Control Security Team at security@trafficcontrol.apache.org and follow the
   guidelines at https://apache.org/security regarding vulnerability disclosure.
   -->
   
   This PR closes #7081 
   <!-- **^ Add meaningful description above** --><hr/>
   
   ## Which Traffic Control components are affected by this PR?
   <!-- Please delete all components from this list that are NOT affected by this PR.
   Feel free to add the name of a tool or script that is affected but not on the list.
   -->
   - Traffic Router
   
   ## What is the best way to verify this PR?
   <!-- Please include here ALL the steps necessary to test your PR.
   If your PR has tests (and most should), provide the steps needed to run the tests.
   If not, please provide step-by-step instructions to test the PR manually and explain why your PR does not need tests. -->
   Follow the steps in #7081 
   Make sure the new information shows up in the logs.
   
   ## If this is a bugfix, which Traffic Control versions contained the bug?
   <!-- Delete this section if the PR is not a bugfix, or if the bug is only in the master branch.
   Examples:
   - 5.1.2
   - 5.1.3 (RC1)
    -->
   - master
   
   ## PR submission checklist
   - [ ] This PR has tests <!-- If not, please delete this text and explain why this PR does not need tests. -->
   - [ ] This PR has documentation <!-- If not, please delete this text and explain why this PR does not need documentation. -->
   - [x] This PR has a CHANGELOG.md entry <!-- A fix for a bug from an ATC release, an improvement, or a new feature should have a changelog entry. -->
   - [x] This PR **DOES NOT FIX A SERIOUS SECURITY VULNERABILITY** (see [the Apache Software Foundation's security guidelines](https://apache.org/security) for details)
   
   <!--
   Licensed to the Apache Software Foundation (ASF) under one
   or more contributor license agreements.  See the NOTICE file
   distributed with this work for additional information
   regarding copyright ownership.  The ASF licenses this file
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at
   
       http://www.apache.org/licenses/LICENSE-2.0
   
   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   KIND, either express or implied.  See the License for the
   specific language governing permissions and limitations
   under the License.
   -->
   


-- 
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: issues-unsubscribe@trafficcontrol.apache.org

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


[GitHub] [trafficcontrol] zrhoffman commented on a diff in pull request #7146: Better messages for Traffic Router exceptions

Posted by GitBox <gi...@apache.org>.
zrhoffman commented on code in PR #7146:
URL: https://github.com/apache/trafficcontrol/pull/7146#discussion_r998716177


##########
traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/protocol/TCP.java:
##########
@@ -112,6 +114,20 @@ public void run() {
                 os.write(response);
             } catch (final WireParseException e) {
                 // This is already recorded in the access log
+            } catch (final SocketTimeoutException e) {
+                String hostAddress = "unknown";
+                if (client != null) {
+                    hostAddress = client.getHostAddress();
+                }
+                LOGGER.error("The socket with the Client at: " +
+                        hostAddress + " has timed out. Error: " + e.getMessage(), e);
+            } catch (final EOFException e) {

Review Comment:
   Syntax error
   
   ```
   core/dns/protocol/TCP.java:[124,27] error: cannot find symbol
   ```



-- 
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: issues-unsubscribe@trafficcontrol.apache.org

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


[GitHub] [trafficcontrol] zrhoffman merged pull request #7146: Better messages for Traffic Router exceptions

Posted by GitBox <gi...@apache.org>.
zrhoffman merged PR #7146:
URL: https://github.com/apache/trafficcontrol/pull/7146


-- 
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: issues-unsubscribe@trafficcontrol.apache.org

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


[GitHub] [trafficcontrol] zrhoffman commented on a diff in pull request #7146: Better messages for Traffic Router exceptions

Posted by GitBox <gi...@apache.org>.
zrhoffman commented on code in PR #7146:
URL: https://github.com/apache/trafficcontrol/pull/7146#discussion_r999684460


##########
traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/protocol/TCP.java:
##########
@@ -112,6 +115,20 @@ public void run() {
                 os.write(response);
             } catch (final WireParseException e) {
                 // This is already recorded in the access log
+            } catch (final SocketTimeoutException e) {
+                String hostAddress = "unknown";
+                if (client != null) {
+                    hostAddress = client.getHostAddress();
+                }
+                LOGGER.error("The socket with the Client at: " +
+                        hostAddress + " has timed out. Error: " + e.getMessage(), e);

Review Comment:
   This still prints the stack trace, which we don't need in this specific case.
   
   ```java
   ERROR 2022-10-19T16:17:45.535 [pool-13-thread-1] org.apache.traffic_control.traffic_router.core.dns.protocol.TCP - The socket with the Client at: 2001:3984:3989:0:0:0:0:3 has timed out. Error: Read timed out
   java.net.SocketTimeoutException: Read timed out
   	at java.net.SocketInputStream.socketRead0(Native Method) ~[?:?]
   	at java.net.SocketInputStream.socketRead(SocketInputStream.java:115) ~[?:?]
   	at java.net.SocketInputStream.read(SocketInputStream.java:168) ~[?:?]
   	at java.net.SocketInputStream.read(SocketInputStream.java:140) ~[?:?]
   	at java.nio.channels.Channels$ReadableByteChannelImpl.read(Channels.java:388) ~[?:?]
   	at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:65) ~[?:?]
   	at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:107) ~[?:?]
   	at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:101) ~[?:?]
   	at java.io.DataInputStream.readFully(DataInputStream.java:200) ~[?:?]
   	at java.io.DataInputStream.readFully(DataInputStream.java:170) ~[?:?]
   	at org.apache.traffic_control.traffic_router.core.dns.protocol.TCP$TCPSocketHandler.run(TCP.java:111) [classes/:?]
   	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
   	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
   	at java.lang.Thread.run(Thread.java:829) [?:?]
   ````
   
   In the dev CDN in a Box, ran
   ```shell
   docker-compose exec trafficops wget -O- trafficrouter:53
   ```



-- 
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: issues-unsubscribe@trafficcontrol.apache.org

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