Giter Club home page Giter Club logo

Comments (13)

michalvasko avatar michalvasko commented on July 18, 2024

So what exactly is happening? I would guess the server disconnected the client because of idle-timeout and once the client sends any RPC, this will be discovered, the client closes the socket, and the connection is properly terminated.

from netopeer2.

lqlucky avatar lqlucky commented on July 18, 2024

I got a log(attached) from which I can see that the client actively disconnected and will repeatedly connect and then disconnect. Tracking "Session 10" further reveals that the client creates one ssh session and open multiple channel
image
netopeer2-server-log.txt

from netopeer2.

michalvasko avatar michalvasko commented on July 18, 2024

Whatever the case, based on what I understand, this TCP state occurs when the connection is closed by one end and not by the other. And unless you can provide more information, I will assume it is the client not closing the connections, which is not something I can help with.

from netopeer2.

lqlucky avatar lqlucky commented on July 18, 2024

According to the TCP state diagram below, we can know netopeer2-server receive the FIN but not send FIN to the remote.
image

I also noticed that this function(nc_session_free_transport), when dealing with multiple NETCONF session, will not immediately close socket. According to the previous log, we know that the client has created multiple NETCONF session in one SSH session. then close SSH session directly. Does this matter?

from netopeer2.

michalvasko avatar michalvasko commented on July 18, 2024

Okay, then I would suggest you use the current latest release in the master branch (or even the devel) of the projects, I seem to remember some changes in how sockets were handled recently. As for freeing multi-channel SSH sessions, you cannot close the socket unless all the channels (NETCONF sessions) were closed because they all use the same SSH session (the same socket).

from netopeer2.

lqlucky avatar lqlucky commented on July 18, 2024

Has the latest devel branch fixed the above scenario?

So for the client, if the connection netopeer2-server uses multi-channel SSH, does it have to be close channel before closing the SSH session connection?

from netopeer2.

michalvasko avatar michalvasko commented on July 18, 2024

Has the latest devel branch fixed the above scenario?

I cannot guarantee it but it is possible.

So for the client, if the connection netopeer2-server uses multi-channel SSH, does it have to be close channel before closing the SSH session connection?

The NETCONF client is supposed to close all the NETCONF sessions, whatever way they were created. And netopeer2 will internally close the socket (SSH session) once there are no NETCONF sessions using it.

from netopeer2.

lqlucky avatar lqlucky commented on July 18, 2024

New discoveries:
netopeer2-server work threads stuck at "nc_session_free_transport"
image

from netopeer2.

michalvasko avatar michalvasko commented on July 18, 2024

I am not able to learn more because no libnetconf2 version I have looked at session.c:762 had any code there that could cause a hang. Please specify the version you are using, I thought you have updated to current devel.

from netopeer2.

lqlucky avatar lqlucky commented on July 18, 2024

I use the version of libnetconf2 is v2.1.37. It hangs in the while loop, please see following code
image

I noticed that the above code has been removed in the new release, so I want to do a patch to remove those code from the current version, but I don't know if it will have any other impact.

from netopeer2.

michalvasko avatar michalvasko commented on July 18, 2024

You are free to apply only a patch but please do not ask for more support. We support only current master and devel versions.

from netopeer2.

lqlucky avatar lqlucky commented on July 18, 2024

Okay, got it. Since updating to the latest devel involves updates to other components, such as openssl, I want to temporarily fix it before updating

from netopeer2.

michalvasko avatar michalvasko commented on July 18, 2024

Then the OpenSSL version you are using is no longer supported, which is a significant security risk.

from netopeer2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.