Git Product home page Git Product logo

Comments (3)

bbrucee avatar bbrucee commented on May 23, 2024

After investigation it looks like the culprit of the bug is the management of the editorManagerMutex https://github.com/OpenDiablo2/HellSpawner/blob/master/hsapp/app.go#L222

The issue appears to be on fast machines, multiple openEditor calls will fire and process such that concurrent executions of the createEditor method reach the lock on L222. This leads to the a.editors list containing multiple entries with the same unique ID.

from hellspawner.

bbrucee avatar bbrucee commented on May 23, 2024

My proposed change is to move the lock acquire from L222 to the beginning of CreateEditor. This will enforce that only one createEditor call will be fired for any given Unique ID. The RLock in the openEditor method will no longer be acquired when a concurrent execution of CreateEditor is generating the editor as opposed to the current behavior where the RLock gets acquired allowing multiple CreateEditors to reach the a.editors = append... line on 224

Edit: This causes the RestoreApp functionality to become laggy as it has to wait to generate each editor object

from hellspawner.

gravestench avatar gravestench commented on May 23, 2024

I think your proposed solution is good enough, I don't think it's a big deal for there to be some reasonable delays during app start. A "reasonable" delay would be ~2 second startup for an existing project with some editors opened.

from hellspawner.

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.