Closed tgulacsi closed 3 years ago
@tgulacsi, I discussed this internally and the conclusion was that there is no way to do this currently. You would need to iterate through the file descriptors and simply close them yourself in the child process prior to calling exec(). Or simply not forget to close the connections in the normal fashion, of course!
Thanks! That's what I thought, too. But worth a try.
In a program I've forgot to close the ODPI connection at the end of the program. The program started a daemon, and that daemon inherited the oracle connections (opened file descriptors). These are seen in CLOSE_WAIT state at client host, and alive sessions on the server.
Go marks the file descriptors before fork-exec as close-on-exec. Can OCI/ODPI do the same?