No way to stop XMLRPC server

Bug #264378 reported by Alexandre Garnier
4
Affects Status Importance Assigned to Milestone
Bazaar Plugin for Eclipse
Fix Released
High
Guillermo Gonzalez
Java library for Bazaar
Fix Released
High
Guillermo Gonzalez
bzr-xmloutput
Fix Released
Medium
Guillermo Gonzalez

Bug Description

There is no other way to stop XMLRPC server than by killing the process if you don't launched it explicitly

For example, BzrEclipse plugin launch the XMLRPC server but doesn't stop it at exit and the process stay alive.

Related branches

description: updated
Revision history for this message
Guillermo Gonzalez (verterok) wrote :

Hi Alexandre,
Thanks for reporting this.
I'll look how to hook into the eclipse shutdown process.
A jvm shutdown hook is already inplace, seems that it's not working correctly.
I'll check and come back with further feedback.

Changed in bzr-eclipse:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Guillermo Gonzalez (verterok) wrote :

It would be *really* nice to have a stop-xmlrpc command

Changed in bzr-xmloutput:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Guillermo Gonzalez (verterok) wrote :

It's committed, if you are running trunk, after pull, stop-xmlrpc command 'll be available.
I'll make a new release in the following days.

Regards.

Changed in bzr-xmloutput:
assignee: nobody → guillo.gonzo
status: Confirmed → Fix Committed
Changed in bzr-eclipse:
assignee: nobody → guillo.gonzo
Changed in bzr-eclipse:
status: Confirmed → In Progress
Changed in bzr-java-lib:
assignee: nobody → guillo.gonzo
importance: Undecided → High
status: New → In Progress
Changed in bzr-java-lib:
status: In Progress → Fix Committed
Changed in bzr-eclipse:
status: In Progress → Fix Committed
Changed in bzr-eclipse:
status: Fix Committed → Fix Released
Revision history for this message
Luis Arias (kaaloo) wrote :

I've experienced issues with committer identity tied to this problem. My work requires me to use different committer emails on different projects. I have an eclipse workspace per committer identity and the email is set using the Team > Bazaar preferences dialog. However, since the xmlrpc server is not exiting when leaving eclipse or switching workspaces, the first used identity is set in the server's environment settings and cannot be changed without first manually killing the process. I will build bzr-eclipse from trunk and test my issues against it. Hopefull the eclipse shutdown hook will work when switching workspaces.

Revision history for this message
Guillermo Gonzalez (verterok) wrote :

Luis,
Thanks for pointing this out.
I completely missed this problem (the environment not been the same between eclipse instances or beteween projects).
I think this could be solved in different ways.
The first two things that came to head are: stopping the xmlrpc service so each eclipse instance have it's own xmlrpc service (this is the current idea/implementation), another solution could be to allow project specific settings, so this would allow you to have only one workspace :).

Regards,

Revision history for this message
Alexandre Garnier (zigarn) wrote :

Maybe the 2 solutions together ?

Revision history for this message
Guillermo Gonzalez (verterok) wrote :

Alexandre,
Sure :)
I messed up trying to explain how to solve the specific issue of multiple workspace config only to setup the email client.
Stopping the xmlrpc-service is a must have, bzr-eclipse shouldn't leave processes around.
About this, did you test the new build? it's the xmlrpc service still alive after closing eclipse?

Cheers,

Revision history for this message
Alexandre Garnier (zigarn) wrote :

No change : the new build leave the xmlrpc server alive.

When stopping Eclipse, I have this in .bzr.log :
45.072 run_bzr_xml arguments: (['/usr/local/bin/bzr', 'xmlversion', '--short'], '.')
45.072 bzr arguments: [u'xmlversion', u'--short']
45.073 encoding stdout as bzrlib.user_encoding 'UTF-8'
45.075 run_bzr_xml arguments: (['/usr/local/bin/bzr', 'quit'], '.')
45.075 bzr arguments: [u'quit']

Quit command on xmlrpc doesn't seem to work.

Revision history for this message
Guillermo Gonzalez (verterok) wrote :

move it back to in progress

Changed in bzr-eclipse:
status: Fix Released → In Progress
Revision history for this message
Guillermo Gonzalez (verterok) wrote :

Alexandre,
That's weird, it should stop it :(
could you try to stop it from the CLI?
i.e:
bzr start-xmlrpc --port=11112
bzr stop-xmlrpc --port=11112

Revision history for this message
Alexandre Garnier (zigarn) wrote :

bzr stop-xmlrpc works just fine -- and I use it to manually stop xmlrpc server after stopping Eclipse.
But stopping Eclipse doesn't stop xmlrpc server. It call 'quit' on xmlrpc server, but doesn't it should call 'stop-xmlrpc --port=XXX' ?

Revision history for this message
Luis Arias (kaaloo) wrote :

Hi Guillermo and Alexandre,

I think that what would be good is for the bzr server to distinguish between general environment settings like PATH and those that might be tied to project specific settings. For the latter, a solution might be to use some kind of session with a timeout like for a servlet request. That way the bzr server could be launched upon first request, but then depending on the session could use different project settings. This means that running a bazaar command on project X would require a session id for that project. The other way would be to have those project specific settings stored on the client (like a cookie) and sent every time a command is run on the server or when a command takes place in the context of a different project than the current project. This last solution is probably the easiest to implement, just update the project specific settings when switching projects.

Luis

Revision history for this message
Guillermo Gonzalez (verterok) wrote :

Hi,
Luis, thanks a lot for the ideas :)
I've been thinking a bit, and maybe bzr-eclipse can leverage most of this per-branch configuration to bzr itself. This is already support by bzr (in locations.conf and branch.conf allows to override global configurations).
So, I'm going to work on first prototype of a GUI for editing those files directly from eclipse.
This would allow Luis to use the same workspace for all the projects and configura the username in a per-project/branch basis, and also keep the current behaviour.
any thoughts?

Cheers.

Revision history for this message
Luis Arias (kaaloo) wrote :

Hi Guillermo,

Well you know I like to use different workspaces because I sometimes work with large codebases that would really bog things down if everything was in the same place, so please don't do anything just so I can use a single workspace. That wouldn't be my use case anyhow. I'm not 100% sure now, but I had tried to do stuff like bzr whoami --branch when I hadn't understood about the xmplrpc server yet, and I seem to remember that the xmlrpc servers configuration was somehow taking precedence over the branch configuration. So that would have to be tested, but otherwise using settings in locations.conf etc.. sounds good.

Revision history for this message
Guillermo Gonzalez (verterok) wrote : Re: [Bug 264378] Re: No way to stop XMLRPC server

Alexandre,
Apologize I missed this post.

On Mon, Sep 15, 2008 at 12:59 PM, Alexandre Garnier
<email address hidden> wrote:
> bzr stop-xmlrpc works just fine -- and I use it to manually stop xmlrpc server after stopping Eclipse.

great to know :)

> But stopping Eclipse doesn't stop xmlrpc server. It call 'quit' on xmlrpc server, but doesn't it should call 'stop-xmlrpc --port=XXX' ?

Actually it call the 'quit' xmlrpc method, which is the same method
used by stop-xmlrpc. Because bzr-eclispe know in what port the xmlrpc
service is running.

I'm debugging different ways of closing/killing (and trying to crash)
eclipse, and how this affects the xmlrpc service and the JVM shutdown
hook.

Regards,

>
> --
> No way to stop XMLRPC server
> https://bugs.launchpad.net/bugs/264378
> You received this bug notification because you are a member of bzr-java
> mantainers, which is subscribed to Java library for Bazaar.
>
> Status in Bazaar Plugin for Eclipse: In Progress
> Status in Java interface for Bazaar: Fix Committed
> Status in Bazaar XML output plugin: Fix Committed
>
> Bug description:
> There is no other way to stop XMLRPC server than by killing the process if you don't launched it explicitly
>
> For example, BzrEclipse plugin launch the XMLRPC server but doesn't stop it at exit and the process stay alive.
>

Revision history for this message
Guillermo Gonzalez (verterok) wrote :

I added a save participant to cleanly shutdown the service, also added various improvements in the port preference handling.
I'll be rolling out a new build in a couple of hours.
Please reopen this bug if you still have this problem

Regards,

Changed in bzr-eclipse:
status: In Progress → Fix Committed
Changed in bzr-eclipse:
status: Fix Committed → Fix Released
Changed in bzr-xmloutput:
status: Fix Committed → Fix Released
Revision history for this message
Alexandre Garnier (zigarn) wrote :

The xmlrpc server is now stopped when closing Eclipse.

Changed in bzr-java-lib:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.