Git Product home page Git Product logo

Comments (6)

NilsFrkal avatar NilsFrkal commented on August 12, 2024

I did a bit more testing and found out that this error only occurs if I explicitly call connection.Close(). This however leads me to another question: Is the RFC connection automatically closed? And if yes, under which conditions? Thank you very much.

from node-sapnwrfc.

ryanwise avatar ryanwise commented on August 12, 2024

I also encounter this bug, albeit running both node and SAP on a linux system. My current attempt to deal with it is to run my app with pm2 to ensure it restarts as soon as it dies. Although I can't help with more details, I can answer your question. Unless connection.Close() is explicitly called, the RFC connection remains in place and can start to use up all available RFC ports over time. You can see the zombie RFC connections on the SAP side through transaction AL08.

from node-sapnwrfc.

NilsFrkal avatar NilsFrkal commented on August 12, 2024

Thanks a lot Ryan. Obviously both, auto-restart of app as well as leaving RFCs open are not production-ready solutions. Is someone able to fix this? Thanks, Nils

from node-sapnwrfc.

HikmetTenis avatar HikmetTenis commented on August 12, 2024

Im getting the same error, do you have any solution for this?

from node-sapnwrfc.

IvanWise avatar IvanWise commented on August 12, 2024

This patch might fix the issue:

---
 src/Connection.cc                    |   8 +++++++-

diff --git a/src/Connection.cc b/src/Connection.cc
--- a/src/Connection.cc
+++ b/src/Connection.cc
@@ -36,7 +36,12 @@ Connection::Connection() :
 
 Connection::~Connection()
 {
-  this->CloseConnection();
+
+	if (this->connectionHandle != nullptr) {
+		RFC_ERROR_INFO errorInfo;
+		memset(&errorInfo, 0, sizeof(RFC_ERROR_INFO));
+		RfcCloseConnection(this->connectionHandle, &errorInfo);
+	}
 
   uv_mutex_destroy(&this->invocationMutex);
 
@@ -201,6 +206,7 @@ v8::Local<v8::Value> Connection::CloseConnection(void)
 
   if (this->connectionHandle != nullptr) {
     rc = RfcCloseConnection(this->connectionHandle, &errorInfo);
+		this->connectionHandle = nullptr;
     if (rc != RFC_OK) {
       scope.Escape(RfcError(errorInfo));
     }
-- 
2.16.2.windows.1

from node-sapnwrfc.

jzakrzewski avatar jzakrzewski commented on August 12, 2024

We've used the same approach in our fork https://github.com/e2ebridge/node-sapnwrfc

from node-sapnwrfc.

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.