Code Monkey home page Code Monkey logo

Comments (5)

vdurante avatar vdurante commented on May 24, 2024 1

@SebastianStehle I spent some time reading about it, and it seems that it is not possible to handle panics the way YDotNet have implemented it. It would require it to run in a separate process or similar :(

Also, the issue I am facing seems quite hard to reproduce. I only saw it happen once. If I am able to consistently reproduce I will try to investigate. Thanks for all the help!

from ydotnet.

SebastianStehle avatar SebastianStehle commented on May 24, 2024

Unfortunately not. It is one of 2 errors:

  1. A panic in rust.
  2. A null pointer.

We are working to solve the second problem with smart pointers, but it is still unsolved. Usually you cannot log anything anymore, when this happens. This also sucks.

from ydotnet.

Horusiath avatar Horusiath commented on May 24, 2024

We're working on this on Rust side and should be able to show some improvements regarding invalid pointers soon.

from ydotnet.

vdurante avatar vdurante commented on May 24, 2024

I might try to fix the panic in rust issue then. Not sure if it is possible to fix that tho, but maybe just add some code to the way we call the rust binaries to catch panics and prevent the pod from going down.

How does ydotnet interact with Rust binaries? Is there any documentation I could read on the topic?

from ydotnet.

SebastianStehle avatar SebastianStehle commented on May 24, 2024

I think it is not possible, because a panic is basically a process.exit(ERROR) in Dotnet. But I would be happy if you could solve that.

There is no documentation, but this is how it works:

  1. Y-crdt has a C binding layer: https://github.com/y-crdt/y-crdt/tree/main/yffi that is used for that.
  2. In out native namespace we have all the code to talk with the channels: https://github.com/y-crdt/ydotnet/blob/main/YDotNet/Native/Document/DocChannel.cs#L15
  3. Sometimes we have to follow pointers, then we always do that in the Native namespace, e.g. here: https://github.com/y-crdt/ydotnet/blob/main/YDotNet/Native/Document/Events/SubDocsEventNative.cs#L21
  4. We expose CLR types that are converted from the native types. The conversion is done outside of the native namespace. The goal is to have a dependency to the native namespaces but not from this namespace to avoid a circular dependency hell. See: https://github.com/y-crdt/ydotnet/blob/main/YDotNet/Document/State/DeleteSet.cs#L10

from ydotnet.

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.