File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1773,10 +1773,12 @@ func (a *agent) Close() error {
1773
1773
a .setLifecycle (codersdk .WorkspaceAgentLifecycleShuttingDown )
1774
1774
1775
1775
// Attempt to gracefully shut down all active SSH connections and
1776
- // stop accepting new ones. If all processes have not exited after
1777
- // 10 seconds, we just log it and move on as it's more important
1778
- // to run the shutdown scripts.
1779
- sshShutdownCtx , sshShutdownCancel := context .WithTimeout (a .hardCtx , 10 * time .Second )
1776
+ // stop accepting new ones. If all processes have not exited after 5
1777
+ // seconds, we just log it and move on as it's more important to run
1778
+ // the shutdown scripts. A typical shutdown time for containers is
1779
+ // 10 seconds, so this still leaves a bit of time to run the
1780
+ // shutdown scripts in the worst-case.
1781
+ sshShutdownCtx , sshShutdownCancel := context .WithTimeout (a .hardCtx , 5 * time .Second )
1780
1782
defer sshShutdownCancel ()
1781
1783
err := a .sshServer .Shutdown (sshShutdownCtx )
1782
1784
if err != nil {
You can’t perform that action at this time.
0 commit comments