socket(): Too many open files for this process.

Discussions related to HTTPAPI (An HTTP Client Package for RPG programming.) http://www.scottklement.com/httpapi/
Post Reply
abreton
Posts: 1
Joined: Mon Jun 27, 2022 7:03 pm

socket(): Too many open files for this process.

Post by abreton »

Since a month ago, we didn't have this problem with too many open files.

I have the version HTTPAPI 1.43.

Does the version 1.45 , Correct these issues ?

Thnk in advance.
Scott Klement
Site Admin
Posts: 635
Joined: Sun Jul 04, 2021 5:12 am

Re: socket(): Too many open files for this process.

Post by Scott Klement »

Each job on the system has a limited number of descriptors that can be open. These descriptors are used for many things: (1) Pipes, (2) IFS files, (3) Sockets. I think the limit is 200 per job by default, but it can be increased.

The problem is that you're exceeding the per-job number. This most likely isn't caused by HTTPAPI -- most likely you have another program running that is leaving IFS files, sockets or pipes open and not closing them properly.

When HTTPAPI tries to open another one, the total number for the job happens to be exceeded. For example, if you have a program that has 199 IFS files open, and then HTTPAPI tries to create a socket, since that socket is the 200th one, and it exceeds the maximum for the job, HTTPAPI will get this error (even though 199 of the 200 are open by a different program.)

You need to investigate what is holding files open in your job. This most likely isn't a problem with HTTPAPI. This problem has been reported many times in the past 20 years, and I don't think it has ever been traced to a problem in HTTPAPI
Post Reply