You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2022/11/04 14:31:09 UTC

[GitHub] [nifi] kulikg opened a new pull request, #6620: NIFI-10702 Clear server list on connection error in SMB processors

kulikg opened a new pull request, #6620:
URL: https://github.com/apache/nifi/pull/6620

   <!-- 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. -->
   
   # Summary
   
   [NIFI-10702](https://issues.apache.org/jira/browse/NIFI-10702)
   
   
   
   ### Issue Tracking
   
   - [x] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue created
   
   ### Pull Request Tracking
   
   - [x] Pull Request title starts with Apache NiFi Jira issue number, such as `NIFI-00000`
   - [x] Pull Request commit message starts with Apache NiFi Jira issue number, as such `NIFI-00000`
   
   ### Pull Request Formatting
   
   - [x] Pull Request based on current revision of the `main` branch
   - [x] Pull Request refers to a feature branch with one commit containing changes
   
   # Verification
   
   Please indicate the verification steps performed prior to pull request creation.
   
   ### Build
   
   - [ ] Build completed using `mvn clean install -P contrib-check`
     - [x] JDK 8
     - [x] JDK 11
     - [x ] JDK 17
   
   ### Licensing
   
   - [x] New dependencies are compatible with the [Apache License 2.0](https://apache.org/licenses/LICENSE-2.0) according to the [License Policy](https://www.apache.org/legal/resolved.html)
   - [x] New dependencies are documented in applicable `LICENSE` and `NOTICE` files
   
   ### Documentation
   
   - [x] Documentation formatting appears as expected in rendered files
   


-- 
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@nifi.apache.org

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


[GitHub] [nifi] tpalfy commented on a diff in pull request #6620: NIFI-10702 Clear server list on connection error in SMB processors

Posted by GitBox <gi...@apache.org>.
tpalfy commented on code in PR #6620:
URL: https://github.com/apache/nifi/pull/6620#discussion_r1016972231


##########
nifi-nar-bundles/nifi-smb-bundle/nifi-smb-smbj-client/src/main/java/org/apache/nifi/services/smb/SmbjClientProviderService.java:
##########
@@ -129,6 +129,7 @@ public SmbClientService getClient() throws IOException {
             getLogger().debug("Closing stale connection and trying to create a new one for share " + getServiceLocation());
 
             closeConnection(connection);
+            unregisterHost();

Review Comment:
   Unfortunately
   ```java
   Connection connection = smbClient.connect(hostname, port);
   ```
   can also fail for the same reason this change is trying to fix.
   
   To my understanding this is because how the connection is cached by the SMBClient.
   Our current approach increases the number of leases on the cached connection every time we ask for one. And those leases are never "returned" by us. So the number of leases increases indefinitely and can almost never reach zero. Except when we have asked for a connection _only once_. If the connection is closed after this first occurrence the number of leases reaches zero and it is discarded.
   
   However the server hostname is already stored so if that changes an exception comes when we ask the client to create a new connection.
   
   Long story short, the
   ```java
   smbClient.connect(hostname, port);
   ```
   call should be in a try-catch block as well.



-- 
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@nifi.apache.org

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


[GitHub] [nifi] asfgit closed pull request #6620: NIFI-10702 Clear server list on connection error in SMB processors

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #6620: NIFI-10702 Clear server list on connection error in SMB processors
URL: https://github.com/apache/nifi/pull/6620


-- 
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@nifi.apache.org

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


[GitHub] [nifi] tpalfy commented on pull request #6620: NIFI-10702 Clear server list on connection error in SMB processors

Posted by GitBox <gi...@apache.org>.
tpalfy commented on PR #6620:
URL: https://github.com/apache/nifi/pull/6620#issuecomment-1309137762

   LGTM+1


-- 
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@nifi.apache.org

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