Closed Bug 418655 Opened 16 years ago Closed 2 years ago

"ssh-agent" lingers after close of msys window

Categories

(Firefox Build System :: MozillaBuild, task)

x86
Windows XP
task
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: swsnyder, Assigned: mhentges)

References

Details

(Whiteboard: [Workaround: Use "ssh-agent -k" to stop the process])

In MozillaBuild v1.2 a copy of ssh-agent is spawned for each window (msys terminal) opened and lingers after the window is closed.

This wastes system RAM and diskspace (each copy of ssh-agent creates it's own set of temporary files).

In addition, this may or may not be related to a problem I see with generated files being held open and thus undeletable.  When I do a second build I often get an error that such-and-such file can't be overwritten because it is in use by another process.  That file was generated on the first build but is held open by either ssh-agent or msys itself.

The above behavior is seen when building with VS2005 on a fully -updated Win2K/SP4 system.
I experience exactly the same problem with Visual Studio Express 2008 on Windows XP SP3 RC2 Refresh (build 5508) with MozillaBuild v1.2.
"Same" with MozillaBuild 1.3 (on Win2K):

*This seems unrelated to Visual Studio:
 Starting <msys.bat> directly does it too.
*Opening first msys window (silently) starts "ssh-agent" (if not already running).
*Closing last msys window does not stop it.


(In reply to comment #0)
> In MozillaBuild v1.2 a copy of ssh-agent is spawned for each window (msys
> terminal) opened and lingers after the window is closed.

I get one "ssh-agent" process only, not one by opened window.
Could you confirm that this is fixed (for you) with MozillaBuild 1.3 ?

> In addition, this may or may not be related to a problem I see with generated
> files being held open and thus undeletable.

(I haven't build with ssh-agent running yet.)
Could you check if this is fixed with MozillaBuild 1.3 ?
OS: Windows 2000 → Windows XP
Whiteboard: [Workaround: Use "ssh-agent -k" to stop the process]
This behavior hasn't changed with 1.3. I'm not likely to fix it anytime soon, but I'd take a patch.
Bug 409114 comment 1:
[
From  ben turner [:bent]   2007-12-19 16:19:05 PDT

I guess the bad thing about this is that the single instance of ssh-agent will
live forever (until shutdown)... but it's pretty small so I dont think anyone
will really care.
]

If we care a little, could it be possible to have an option to stop it automatically ?
Depends on: 409114
If you care a little, write a patch. I'm not going to fix this.
OK.  Where it seems this actually does cause an issue is with the Windows 7 Task Manager.  I do a once a day build from mozilla-central including a list of extra patches scheduled via Windows 7 Task Manager.  Seems I end up with a number of ssh-agents equal to the number of days since the last Microsoft Tuesday (hence the last system reboot)  It seems the fact that this process gets killed when the user logs off does not occur for jobs run via the ask manager.  I added an "ssh-agent -k" to the end of the script my build process runs to try to fix this.
(In reply to Bill Gianopoulos from comment #6)
> OK.  Where it seems this actually does cause an issue is with the Windows 7
> Task Manager.  I do a once a day build from mozilla-central including a list
> of extra patches scheduled via Windows 7 Task Manager.  Seems I end up with
> a number of ssh-agents equal to the number of days since the last Microsoft
> Tuesday (hence the last system reboot)  It seems the fact that this process
> gets killed when the user logs off does not occur for jobs run via the ask
> manager.  I added an "ssh-agent -k" to the end of the script my build
> process runs to try to fix this.

Adding the 'ssh-agent -k' to the end of the script that my task manager scheduled task runs fixed the issue for me.
I'm open to working on this, but I'm not sure what would need to be done to auto-kill ssh-agent when the terminal is closed.

This will likely be solved by embracing the SSH client embedded into Windows itself.

Assignee: nobody → mhentges
Status: NEW → ASSIGNED

As of the MSYS2 migration, there's no longer a new ssh-agent process for every new MozillaBuild terminal opened.
However, it still doesn't close the last one created when the terminal shuts off.

but I'm not sure what would need to be done to auto-kill ssh-agent when the terminal is closed.

I feel the same way: I'm not sure the best of rectifying this, or if it even makes to.
There's still the downside of MozillaBuild files being "in use" even after the terminal is closed (even then, this shouldn't hardly affect anyone unless they're uninstalling/reinstalling MozillaBuild).
Defaulting to Windows' SSH will resolve this issue further, since we're letting Windows manage the ssh-agent lifecycle instead.

TL;DR: I don't think this is worth fixing, because now there's at most one ssh-agent.exe, and even that will only be created if your Windows doesn't have SSH built-in.

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → WONTFIX
Product: mozilla.org → Firefox Build System
You need to log in before you can comment on or make changes to this bug.