One Star

tssh timeout + process blocked

Hello,
I have a problem with the component tssh. I'm using this component to send a file to an API. (I don't use the tRest component because we can't indicate a file to upload. We only can use the content of a variable. That's too long to put the whole file content in a variable).
So I used my tssh with only one command line simple :
"curl -d @"+((String)globalMap.get("CurrentFile"))+".tmp "+context.api_url
(After the tssh component I use a row on a tjavaFlex. The outputs of tssh are the global variable)
I try with and without timeOut on the component. In the two cases, it's arrived that the process java freeze while the curl was ended. This case seems arrived when the response of the api is superior at 5 minutes. I saw the curl process disappeared but my process java blocked.
So I have two problem :
- The timeOut of tssh component seem didn't work
- The tssh looses the connection with his child process and seem wait a signal to wake up
How can I resolve this problems ?
(I use TOS 5.0.1 in java)
Thank you,
Carole
4 REPLIES
One Star

Re: tssh timeout + process blocked

Hi Carole
The code related to timeout in Talend job is
conn_tSSH_1.connect(null, 0, 61 * 1000);

The method is ch.ethz.ssh2.Connection.connect(ServerHostKeyVerifier verifier, int connectTimeout, int
kexTimeout).
According to the document of ch.ethz.ssh2, it says that
kexTimeout - Timeout for complete connection establishment (non-negative, in milliseconds). Zero means no timeout. The timeout counts from the moment you invoke the connect() method and is cancelled as soon as the first key-exchange round has finished. It is possible that the timeout event will be fired during the invocation of the verifier callback, but it will only have an effect after the verifier returns.

It is possible that the timeout event will be fired during the invocation of the verifier callback, but it will only have an effect after the verifier returns.
So that may be the reason why timeout doesn't work. There is no returns.
You'd better check the api url you use.
Maybe just test the command which you typed in tSSH by linux terminal.
Does anybody encounter this issue before?
I test timeout in TOS 5.0.1. It doesn't work, yet.
Regards,
Pedro
One Star

Re: tssh timeout + process blocked

Hi Pedro,
Thank you for your answer.
Do you know how do I handle the case where the precessus not responding ? How to get into error if there is no return of commands executed after x minutes?
Kind regards,
Carole
One Star

Re: tssh timeout + process blocked

Hi Carole
To tell the truth, I don't know.
Though timeout doesn't work, I can get returns every time.
As I mentioned above, try this command in Linux terminal...
Regards,
Pedro
One Star

Re: tssh timeout + process blocked

I think I have fix the problem adding an exit command.