Coder Social home page Coder Social logo

Comments (7)

virusman avatar virusman commented on May 14, 2024 1

Yeah, I see the same thing: syncthing forks a new process upon launch. I think this is by design. I launched syncthing from command line, and it also spawned two processes.
@enaloha Threads and processes are different things, both can be used for different reasons; and forking new processes is definitely common practice for daemons.

from syncthing-macos.

xor-gate avatar xor-gate commented on May 14, 2024

I can verify this also on my system. They are sub processes of each other so no double syncthing instances are running (multithreaded application). See my activity log screenshot below with detailed process info.

  • pid 397 - Syncthing.app started with launchd (osx process launcher)
    • pid 398 (process group 398) - syncthing master process
      • pid 42535 (process group 398) - syncthing child process (threads)

screen shot 2017-08-14 at 07 40 06

cc @virusman do you agree with this?

from syncthing-macos.

enaloha avatar enaloha commented on May 14, 2024

I have observed this issue and I think it might be a bug (or at least a problem). I don't think this has anything to do with multi-threading. These are clearly two processes with individual PIDs (if each app would open a PID for each thread it would be crazy). Anyway, the problem is that whenever Syncthing demon hangs and I need to terminate via the "Quit Syncthing" menu item, the Syncthing app will hang because it cannot shut down both PIDs (only one is closed).

from syncthing-macos.

xor-gate avatar xor-gate commented on May 14, 2024

Yes syncthing-macosx bundle starts syncthing daemon as its child process and are two separated processes. It weird you have to kill syncthing, I have not had any problem with it as long as I'm using my own syncthing-macosx. But you are right it should be "easier to kill". A simple solution doesn't come to my mind yet.

from syncthing-macos.

xor-gate avatar xor-gate commented on May 14, 2024

This is the nature of golang applications, it always spawns minimal two processes. The runtime automatically scales over multiple threads.

from syncthing-macos.

xor-gate avatar xor-gate commented on May 14, 2024

To protect against two running syncthing daemons spawned from syncthing-macosx we probably could store a pidfile and try to kill it before starting a new instance (and removing the file). I'm not sure syncthing daemon will detach from the syncthing-macosx parent process when something goes wrong. But this needs some investigation and work.

from syncthing-macos.

xor-gate avatar xor-gate commented on May 14, 2024

I'm closing this, as I think it as I have investigated earlier. Its just a sub-process of syncthing. It would also be nice to control the actual start/stop/restart of the subprocess (See #48). Feel free to comment or ask if something is unclear.

from syncthing-macos.

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.