Opened 13 years ago

Closed 12 years ago

#377 closed bug (Fixed)

True classic mode, no separate daemon process

Reported by: andar Owned by: andar
Priority: major Milestone: 1.2.0
Component: Core Version: 1.1.0_dev
Keywords: Cc:

Description

Classic mode currently works by just starting a deluged process. I would like to change this to create a deluge.core.core object instead and use a wrapper in ui.client to pretend it's connecting to a regular daemon. This should improve performance for users who prefer not to take advantage of the daemon/ui split. This will likely depend on the SignalReceiver? removal #365

Change History (4)

comment:1 Changed 12 years ago by Keerthi

In component.py, changed the shutdown function from

    def shutdown(self):
        """Shuts down all components.  This should be called when the program
        exits so that components can do any necessary clean-up."""
        # Stop all components first
        self.stop()
        for component in self.components.keys():
            log.debug("Shutting down component %s..", component)
            try:
                self.components[component].shutdown()
            except Exception, e:
                log.debug("Unable to call shutdown(): %s", e)

to

                
    def shutdown(self):
        """Shuts down all components.  This should be called when the program
        exits so that components can do any necessary clean-up."""
        # Stop all components first
        self.stop()
        for component in self.components.keys():
            log.debug("Shutting down component %s..", component)
            try:
                if self.components[component].get_state() != COMPONENT_STATE.index("Stopped"):
                    self.components[component].shutdown()
            except Exception, e:
                log.debug("Unable to call shutdown(): %s", e)

That fixed the issue.

The fix is to shutdown a component only if is NOT already Stopped.

comment:2 Changed 12 years ago by andar

I don't understand how this creates a true classic mode?

Also, I don't believe this code is correct. A component should be shutdown irregardless of if it's stopped or not. The idea is that the 'Stopped' state is when there is no connection to a core (from a client perspective, this doesn't matter as much from the core perspective) and the 'Shutdown' state is for when the program is exiting. This is important because you can disconnect from one core and connect to another, but when exiting a program you want it to shutdown irregardless of if it's stopped or not. Plus, I believe the shutdown procedure will stop a component prior to shutdown.

comment:3 Changed 12 years ago by Keerthi

Oops! I don't understand how I ended up posting that comment here. It was intended for Bug# 598.

comment:4 Changed 12 years ago by andar

  • Resolution set to fixed
  • Status changed from new to closed

This has been implemented in trunk.

Note: See TracTickets for help on using tickets.