Project

General

Profile

Bug #8028

SIGINT/Ctrl+C does not interrupt system upgrade

Added by Karl-Philipp Richter over 5 years ago. Updated about 4 years ago.

Status:
Resolved
Priority:
Nice to have
Assignee:
Sean Fagan
Category:
OS
Target version:
Seen in:
Severity:
New
Reason for Closing:
Reason for Blocked:
Needs QA:
Yes
Needs Doc:
Yes
Needs Merging:
Yes
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

Selecting `System upgrade` in the main console is not interruptible by pressing Ctrl+C because a forked process continues to run in the background printing its output to the console. The next step after interrupting was the output of a GRUB update and other.

History

#1 Updated by Jordan Hubbard over 5 years ago

  • Category set to 1
  • Assignee set to Sean Fagan
  • Target version set to Unspecified

Hmmm. We should probably trap SIGINT and DTRT with it. It sounds like only part of the installation gets interrupted, whereas we should either mask it if it's dangerous to do it, or unwind properly.

#2 Updated by Karl-Philipp Richter over 5 years ago

I forgot to mention - as a halfway experienced python programmer - that signal handling python is overly complex if not terrible - not only because the transmission for different modules, like `subprocess`, `mulitprocessing` and `os`, doesn't seem to be based on the same/a concept, but also because some signals are caught by the interpreter an some not and some are only caught when using one of the named modules and others not.

#3 Updated by Sean Fagan over 5 years ago

  • Status changed from Unscreened to Screened

The real problem is how the exceptions are handled throughout the multiple layers of code, and how a keyboard exception is treated.

I had to special case it in some code, no doubt I've not got it in others.

Then netcli also complicates it, for its own reasons.

#4 Updated by Jordan Hubbard over 4 years ago

  • Status changed from Screened to Resolved

This works now. Resolving it for Sef since he doesn't look at his old bugs.

#5 Updated by Sean Fagan over 4 years ago

It behaves for you? It's not for me. Hm.

#6 Updated by Jordan Hubbard over 4 years ago

[root@freenas] ~# freenas-update update
TryGetNetworkFile(['http://update-master.freenas.org/FreeNAS/FreeNAS-10-Nightlies/LATEST'])
TryGetNetworkFile(['http://update-master.freenas.org/FreeNAS/FreeNAS-10-Nightlies/LATEST']): Read 8675 bytes total
No signature in manifest
/usr/local/lib/freenasOS/Update.py:797: ResourceWarning: unclosed file <_io.BufferedRandom name=5>
latest_mani = conf.FindLatestManifest(train, require_signature=True)
Going to try checking cached manifest /var/db/system/update/MANIFEST
Got this exception: [Errno 2] No such file or directory: '/var/db/system/update/MANIFEST'
Unable to create directory /var/db/system/update: [Errno 17] File exists: '/var/db/system/update'
Hopefully the current cache is okay
DownloadUpdate: diffs = {'Packages': [(<freenasOS.Package.Package object at 0x807740b50>, 'upgrade', <freenasOS.Package.Package object at 0x8077401f8>), (<freenasOS.Package.Package object at 0x807740bb8>, 'upgrade', <freenasOS.Package.Package object at 0x807740608>), (<freenasOS.Package.Package object at 0x807740c20>, 'upgrade', <freenasOS.Package.Package object at 0x8077406d8>), (<freenasOS.Package.Package object at 0x8077409b0>, 'upgrade', <freenasOS.Package.Package object at 0x807740a80>), (<freenasOS.Package.Package object at 0x807740a18>, 'upgrade', <freenasOS.Package.Package object at 0x807740ae8>)], 'Reboot': True, 'Sequence': ('26a6311c1614764c89562724b60a21ce', 'bba96cd63bba5b7b0a3ac3712ef6f207')}
DownloadUpdate: Will upgrade package base-os
DownloadUpdate: Will upgrade package freebsd-pkgdb
DownloadUpdate: Will upgrade package freenas-pkg-tools
DownloadUpdate: Will upgrade package freenasUI
DownloadUpdate: Will upgrade package middleware
Update does seem to require a reboot
Searching for base-os-10.3-MASTER-201604050930-bba96cd63bba5b7b0a3ac3712ef6f207.tgz
TryGetNetworkFile(['http://update.freenas.org/FreeNAS/Packages/base-os-10.3-MASTER-201604050930-bba96cd63bba5b7b0a3ac3712ef6f207.tgz', 'http://update-master.freenas.org/FreeNAS/Packages/base-os-10.3-MASTER-201604050930-bba96cd63bba5b7b0a3ac3712ef6f207.tgz'])
TryGetNetworkFile(['http://update.freenas.org/FreeNAS/Packages/base-os-10.3-MASTER-201604050930-bba96cd63bba5b7b0a3ac3712ef6f207.tgz', 'http://update-master.freenas.org/FreeNAS/Packages/base-os-10.3-MASTER-201604050930-bba96cd63bba5b7b0a3ac3712ef6f207.tgz']): Read 1048576 bytes
TryGetNetworkFile(['http://update.freenas.org/FreeNAS/Packages/base-os-10.3-MASTER-201604050930-bba96cd63bba5b7b0a3ac3712ef6f207.tgz', 'http://update-master.freenas.org/FreeNAS/Packages/base-os-10.3-MASTER-201604050930-bba96cd63bba5b7b0a3ac3712ef6f207.tgz']): Read 2097152 bytes
TryGetNetworkFile(['http://update.freenas.org/FreeNAS/Packages/base-os-10.3-MASTER-201604050930-bba96cd63bba5b7b0a3ac3712ef6f207.tgz', 'http://update-master.freenas.org/FreeNAS/Packages/base-os-10.3-MASTER-201604050930-bba96cd63bba5b7b0a3ac3712ef6f207.tgz']): Read 3145728 bytes
^C
Received exception during download phase, cannot update
sys:1: ResourceWarning: unclosed file <_io.BufferedRandom name='/var/db/system/update/base-os-10.3-MASTER-201604050930-bba96cd63bba5b7b0a3ac3712ef6f207.tgz'>
sys:1: ResourceWarning: unclosed file <_io.BufferedRandom name='/var/db/system/update/MANIFEST'>

It caught the exception and exited. That's about the most I would have expected?

#7 Updated by Sean Fagan over 4 years ago

I think it may depend on when you try.

Or it may have been my own version, which sometimes doesn't match the released version :).

#8 Avatar?id=14398&size=24x24 Updated by Kris Moore about 4 years ago

  • Target version changed from Unspecified to N/A

Also available in: Atom PDF