SAP / node-rfc

Asynchronous, non-blocking SAP NW RFC SDK bindings for Node.js
Apache License 2.0
251 stars 73 forks source link

CM_NO_DATA_RECEIVED error or segfault after closing the connection of ongoing RFC call #132

Closed bsrdjan closed 4 years ago

bsrdjan commented 4 years ago

lock.js

WAIT_SECONDS = 1;

client.connect((err, res) => {
    if (err) return console.error(err);
    console.log('connected');

    client.invoke('/COE/RBP_FE_WAIT', {
            IV_SECONDS: WAIT_SECONDS
        },
        err => {
            if (err) return console.error(err);
            console.log('executed');
        });

    client.close(
        err => {
            if (err) return console.error(err);
            console.log('closed');
        });

})
$node ci/test/lock.js

{
  name: 'RfcLibError',
  code: 1,
  key: 'RFC_COMMUNICATION_FAILURE',
  message: 'connection closed without message (CM_NO_DATA_RECEIVED)'
}

#or

[1]    74222 segmentation fault  node ci/test/lock.js
bsrdjan commented 4 years ago

Fixed in 1.0.7 by raising an error if close() requested during ongoing RFC call: Close rejected because 1 RFC calls still running