Giter Site home page Giter Site logo

Comments (4)

m-dahl avatar m-dahl commented on August 22, 2024

Hi,

Sorry for the delay. Yes it does look like the call to drop should be removed. But perhaps the bigger issue is that we panic in the error handling. Looks like we didn't expect returning the loaned message to ever fail. I am not familiar with the loan message api. What would be an appropriate course of action if returning the loan fails? Try to return again until successful or just leave it be?

from r2r.

tobiasstarkwayve avatar tobiasstarkwayve commented on August 22, 2024

That is a good question. I think a panic is not the worst reaction here, there is really no conceivable reason why returning a message should ever fail unless there is some form of corruption. Take a quick look at the errors specified by rcl:

  • RCL_RET_INVALID_ARGUMENT, RCL_RET_SUBSCRIPTION_INVALID are both about passing an invalid parameter. That can't happen unless there is a bug in r2r, so a panic seems the right choice there.
  • RCL_RET_UNSUPPORTED would be a strange error indeed, as we should have already gotten this when loaning the message. So I'd argue this is also a bug in r2r if it happens, and panicking is the right call

In our case, the way we triggered it is to have some sort of memory corruption on the iceoryx level. So a panic was absolutely appropriate there as well.

So overall, I'd recommend to keep it a panic and touch it again if somebody complains and points out a valid scenario where returning a loaned message can legitimately fail.

edit: by the way, if that argument makes sense to you I'm happy to submit a PR with my proposed approach.

from r2r.

m-dahl avatar m-dahl commented on August 22, 2024

I agree with your comments. I realize that I mistakenly pushed some code I added to test out your scenario. Happy to accept a PR in any case.

from r2r.

m-dahl avatar m-dahl commented on August 22, 2024

Fixed by #97.

from r2r.

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.