Giter Site home page Giter Site logo

Comments (11)

kosloot avatar kosloot commented on June 21, 2024

I assume this indirectly caused by the TiCC::tempname() function which creates an unique named file.
The calling program may use this file/filename for some time, but at some point it is responsible for removing it.
Frog doesn't do this, nor in Server mode (around line 874 of FrogAPI.cxx ) nor in the Frogtostring() function which is made specially for python-frog. , (around line 1149, needs some refactoring to delete the file before the return)

from frog.

kosloot avatar kosloot commented on June 21, 2024

Addition: There are other programs that use TiCC::tempname(). They should all be investigated.

A more sustainable and C++ like solution is to build "tempstream" class around tempname() which will clean up automatically when the object gets out of scope.
Should't be that hard.

from frog.

kosloot avatar kosloot commented on June 21, 2024

I fixed this in frog using a new tmp_stream() class at 2 locations.
Other locations where TiCC::tempname() was used already removed the temporary file, so all is sound now.

When the code is tested enough, the new tmp_stream class might be incorporated in ticcutils for general uses

Happy testing!

from frog.

proycon avatar proycon commented on June 21, 2024

Ah! Thanks! :) I told @StergiosMorakis I'd look at it next week but you beat me to it already, he'll be happy to hear that. I'll give it a test soon.

from frog.

proycon avatar proycon commented on June 21, 2024

@StergiosMorakis Is everything running nicely still after Ko's patch? Then I'll do a release.

from frog.

proycon avatar proycon commented on June 21, 2024

Released v0.21 which fixes this issue.

from frog.

padurucr7 avatar padurucr7 commented on June 21, 2024

@proycon , we are facing issues with centos 7 with other dependencies . For now i am planning to use older version . I want to cherry-pic changes related to this fix to older version
Found these related changes for this fix . Can you please check if there are any other commits related to this
a24ac9c
7a49cdc
4dc4b87

from frog.

proycon avatar proycon commented on June 21, 2024

Yes, those are indeed the right commits pertaining to this issue.

from frog.

padurucr7 avatar padurucr7 commented on June 21, 2024

@StergiosMorakis this is deleting files in /tmp folder but python is still maintaing the file descriptor count . Ideally this reference should be deleted after closing the file

So python-frog is failing to create another file in /tmp after it processes n request ( n = number set under ulimit -n )
what's the ulimit -n set to in your machine ?

Edit:-
Is this working fine for you ?

from frog.

proycon avatar proycon commented on June 21, 2024

@padurucr7 Are you running into this problem despite the patches in those three commits?? Then we should reopen the issue I guess.

from frog.

padurucr7 avatar padurucr7 commented on June 21, 2024

yeah , not sure why python is maintaining file descriptors ever after closing them in c++ part .
I went through the code and everything looks fine . May b this is issue with python .
So , i am explicitly closing file descriptors related to frog after each query . This fixed the issue

Note:- This issue is no way related to those 3 commits . It's happening with out these commits too .


    base = '/proc/self/fd'
    file_handler_idxs =[]
    for num in os.listdir(base):
        path = None
        try:
            path = os.readlink(os.path.join(base, num))
            if path is not None and "frog" in path:
                file_handler_idxs.append(num)
        except Exception as e:
            print(e)
            pass
    for idx,val in enumerate(file_handler_idxs):
        os.close(int(val))

from frog.

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.