Giter Club home page Giter Club logo

Comments (8)

liuh-80 avatar liuh-80 commented on August 27, 2024

ACK, will start investigation this issue.

from sonic-swss-common.

liuh-80 avatar liuh-80 commented on August 27, 2024

I found there are 2 place have infinite loop issue:

https://github.com/Azure/sonic-swss-common/blob/15c0f729648ee9f26ac9aea767d5712db34ca298/common/pubsub.cpp#L125

https://github.com/Azure/sonic-swss-common/blob/36e1f61691df7aa44782a377e4082cc4380f1018/common/configdb.h#L97

We need exit these infinite loop when receive SIGTERM by add a SIGTERM handler and check SIGTERM status in loop. also we may need check if other signal also need handle, for example SIGKILL

Also need check if some other place in swss common have same issue.

from sonic-swss-common.

liat-grozovik avatar liat-grozovik commented on August 27, 2024

@qiluo-msft any reason the issue is not opened on buildimage for tracking? i believe we only track it and not submodules.

from sonic-swss-common.

liuh-80 avatar liuh-80 commented on August 27, 2024

To minimize code change and make code scalable, my proposal is:
1.Add a CancellationToken class.
2.And add new parameter to these existed API.
3.Code change in hostcfgd to use the new API with a signal handler.

from sonic-swss-common.

liuh-80 avatar liuh-80 commented on August 27, 2024

Here is a draft PR for this issue:

#606

from swsscommon import swsscommon

global_cancellation_token = swsscommon.SignalHandlerHelper.GetCancellationToken(2)
swsscommon.SignalHandlerHelper.RegisterSignalHandler(2)

c=swsscommon.ConfigDBConnector()
c.subscribe('A', lambda a: None)
c.connect()
c.listen(global_cancellation_token, None)
^C>>>

from sonic-swss-common.

liuh-80 avatar liuh-80 commented on August 27, 2024

Update: here is latest example:

from swsscommon import swsscommon

global_cancellation_token = swsscommon.CancellationToken()

swsscommon.SignalHandlerHelper.RegisterCancellationToken(2, global_cancellation_token)
swsscommon.SignalHandlerHelper.RegisterSignalHandler(2)

c=swsscommon.ConfigDBConnector()
c.subscribe('A', lambda a: None)
c.connect()
c.listen(global_cancellation_token, None)

^C>>>

from sonic-swss-common.

qiluo-msft avatar qiluo-msft commented on August 27, 2024

@qiluo-msft any reason the issue is not opened on buildimage for tracking? i believe we only track it and not submodules.

If it is obvious issue in submodule, we will move it to submodule's repo.

from sonic-swss-common.

liat-grozovik avatar liat-grozovik commented on August 27, 2024

@liuh-80, @qiluo-msft as this one is blocking sonic-net/sonic-buildimage#10510. can you please see how we can expedite the solution and the review?

from sonic-swss-common.

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.