[lxc-devel] [lxd/master] DEBUG: restart hangs

stgraber on Github lxc-bot at linuxcontainers.org
Thu Jun 6 21:17:25 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190606/0f759537/attachment.bin>
-------------- next part --------------
From 18a45fe169a87ff2f8c2688cdd4da8f0d5eb4558 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Thu, 6 Jun 2019 23:16:47 +0200
Subject: [PATCH] DEBUG: restart hangs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxc/action.go |  12 ++++
 test/main.sh  | 170 +++++++++++++++++++++++++-------------------------
 2 files changed, 97 insertions(+), 85 deletions(-)

diff --git a/lxc/action.go b/lxc/action.go
index e41e5f530e..ef253db681 100644
--- a/lxc/action.go
+++ b/lxc/action.go
@@ -11,6 +11,7 @@ import (
 	"github.com/lxc/lxd/lxc/utils"
 	"github.com/lxc/lxd/shared"
 	"github.com/lxc/lxd/shared/api"
+	"github.com/lxc/lxd/shared/logger"
 	cli "github.com/lxc/lxd/shared/cmd"
 	"github.com/lxc/lxd/shared/i18n"
 )
@@ -137,20 +138,24 @@ func (c *cmdAction) doAction(action string, conf *config.Config, nameArg string)
 		state = true
 	}
 
+	logger.Errorf("stgraber: %s for %s: here", action, nameArg)
 	remote, name, err := conf.ParseRemote(nameArg)
 	if err != nil {
 		return err
 	}
 
+	logger.Errorf("stgraber: %s for %s: here1", action, nameArg)
 	d, err := conf.GetContainerServer(remote)
 	if err != nil {
 		return err
 	}
 
+	logger.Errorf("stgraber: %s for %s: here2", action, nameArg)
 	if name == "" {
 		return fmt.Errorf(i18n.G("Must supply container name for: ")+"\"%s\"", nameArg)
 	}
 
+	logger.Errorf("stgraber: %s for %s: here3", action, nameArg)
 	if action == "start" {
 		current, _, err := d.GetContainer(name)
 		if err != nil {
@@ -168,6 +173,7 @@ func (c *cmdAction) doAction(action string, conf *config.Config, nameArg string)
 		}
 	}
 
+	logger.Errorf("stgraber: %s for %s: here4", action, nameArg)
 	req := api.ContainerStatePut{
 		Action:   action,
 		Timeout:  c.flagTimeout,
@@ -175,11 +181,13 @@ func (c *cmdAction) doAction(action string, conf *config.Config, nameArg string)
 		Stateful: state,
 	}
 
+	logger.Errorf("stgraber: %s for %s: here5", action, nameArg)
 	op, err := d.UpdateContainerState(name, req, "")
 	if err != nil {
 		return err
 	}
 
+	logger.Errorf("stgraber: %s for %s: here6", action, nameArg)
 	progress := utils.ProgressRenderer{
 		Quiet: c.global.flagQuiet,
 	}
@@ -190,12 +198,14 @@ func (c *cmdAction) doAction(action string, conf *config.Config, nameArg string)
 	}
 
 	// Wait for operation to finish
+	logger.Errorf("stgraber: %s for %s: here7", action, nameArg)
 	err = utils.CancelableWait(op, &progress)
 	if err != nil {
 		progress.Done("")
 		return fmt.Errorf("%s\n"+i18n.G("Try `lxc info --show-log %s` for more info"), err, nameArg)
 	}
 
+	logger.Errorf("stgraber: %s for %s: here8", action, nameArg)
 	progress.Done("")
 
 	return nil
@@ -242,7 +252,9 @@ func (c *cmdAction) Run(cmd *cobra.Command, args []string) error {
 	}
 
 	// Run the action for every listed container
+	logger.Errorf("stgraber: Running %s for %v", cmd.Name(), names)
 	results := runBatch(names, func(name string) error { return c.doAction(cmd.Name(), conf, name) })
+	logger.Errorf("stgraber: Results: %v", results)
 
 	// Single container is easy
 	if len(results) == 1 {
diff --git a/test/main.sh b/test/main.sh
index 1550f686de..9893f983dc 100755
--- a/test/main.sh
+++ b/test/main.sh
@@ -154,92 +154,92 @@ if [ "$#" -gt 0 ]; then
   exit
 fi
 
-run_test test_check_deps "checking dependencies"
-run_test test_static_analysis "static analysis"
-run_test test_database_update "database schema updates"
-run_test test_database_restore "database restore"
-run_test test_sql "lxd sql"
-run_test test_projects_default "default project"
-run_test test_projects_crud "projects CRUD operations"
-run_test test_projects_containers "containers inside projects"
-run_test test_projects_snapshots "snapshots inside projects"
-run_test test_projects_backups "backups inside projects"
-run_test test_projects_profiles "profiles inside projects"
-run_test test_projects_profiles_default "profiles from the global default project"
-run_test test_projects_images "images inside projects"
-run_test test_projects_images_default "images from the global default project"
-run_test test_projects_storage "projects and storage pools"
-run_test test_projects_network "projects and networks"
-run_test test_remote_url "remote url handling"
-run_test test_remote_admin "remote administration"
-run_test test_remote_usage "remote usage"
-run_test test_basic_usage "basic usage"
-run_test test_container_devices_nic_p2p "container devices - nic - p2p"
-run_test test_container_devices_nic_bridged "container devices - nic - bridged"
-run_test test_container_devices_nic_physical "container devices - nic - physical"
-run_test test_container_devices_nic_macvlan "container devices - nic - macvlan"
-run_test test_container_devices_nic_ipvlan "container devices - nic - ipvlan"
-run_test test_security "security features"
-run_test test_security_protection "container protection"
-run_test test_image_expiry "image expiry"
-run_test test_image_list_all_aliases "image list all aliases"
-run_test test_image_auto_update "image auto-update"
-run_test test_image_prefer_cached "image prefer cached"
-run_test test_image_import_dir "import image from directory"
-run_test test_concurrent_exec "concurrent exec"
-run_test test_concurrent "concurrent startup"
-run_test test_snapshots "container snapshots"
-run_test test_snap_restore "snapshot restores"
-run_test test_snap_expiry "snapshot expiry"
-run_test test_config_profiles "profiles and configuration"
-run_test test_config_edit "container configuration edit"
-run_test test_config_edit_container_snapshot_pool_config "container and snapshot volume configuration edit"
-run_test test_container_metadata "manage container metadata and templates"
-run_test test_container_snapshot_config "container snapshot configuration"
-run_test test_server_config "server configuration"
-run_test test_filemanip "file manipulations"
-run_test test_network "network management"
+###run_test test_check_deps "checking dependencies"
+###run_test test_static_analysis "static analysis"
+###run_test test_database_update "database schema updates"
+###run_test test_database_restore "database restore"
+###run_test test_sql "lxd sql"
+###run_test test_projects_default "default project"
+###run_test test_projects_crud "projects CRUD operations"
+###run_test test_projects_containers "containers inside projects"
+###run_test test_projects_snapshots "snapshots inside projects"
+###run_test test_projects_backups "backups inside projects"
+###run_test test_projects_profiles "profiles inside projects"
+###run_test test_projects_profiles_default "profiles from the global default project"
+###run_test test_projects_images "images inside projects"
+###run_test test_projects_images_default "images from the global default project"
+###run_test test_projects_storage "projects and storage pools"
+###run_test test_projects_network "projects and networks"
+###run_test test_remote_url "remote url handling"
+###run_test test_remote_admin "remote administration"
+###run_test test_remote_usage "remote usage"
+###run_test test_basic_usage "basic usage"
+###run_test test_container_devices_nic_p2p "container devices - nic - p2p"
+###run_test test_container_devices_nic_bridged "container devices - nic - bridged"
+###run_test test_container_devices_nic_physical "container devices - nic - physical"
+###run_test test_container_devices_nic_macvlan "container devices - nic - macvlan"
+###run_test test_container_devices_nic_ipvlan "container devices - nic - ipvlan"
+###run_test test_security "security features"
+###run_test test_security_protection "container protection"
+###run_test test_image_expiry "image expiry"
+###run_test test_image_list_all_aliases "image list all aliases"
+###run_test test_image_auto_update "image auto-update"
+###run_test test_image_prefer_cached "image prefer cached"
+###run_test test_image_import_dir "import image from directory"
+###run_test test_concurrent_exec "concurrent exec"
+###run_test test_concurrent "concurrent startup"
+###run_test test_snapshots "container snapshots"
+###run_test test_snap_restore "snapshot restores"
+###run_test test_snap_expiry "snapshot expiry"
+###run_test test_config_profiles "profiles and configuration"
+###run_test test_config_edit "container configuration edit"
+###run_test test_config_edit_container_snapshot_pool_config "container and snapshot volume configuration edit"
+###run_test test_container_metadata "manage container metadata and templates"
+###run_test test_container_snapshot_config "container snapshot configuration"
+###run_test test_server_config "server configuration"
+###run_test test_filemanip "file manipulations"
+###run_test test_network "network management"
 run_test test_idmap "id mapping"
-run_test test_template "file templating"
-run_test test_pki "PKI mode"
-run_test test_devlxd "/dev/lxd"
-run_test test_fuidshift "fuidshift"
-run_test test_migration "migration"
-run_test test_fdleak "fd leak"
-run_test test_storage "storage"
-run_test test_storage_volume_snapshots "storage volume snapshots"
-run_test test_init_auto "lxd init auto"
-run_test test_init_interactive "lxd init interactive"
-run_test test_init_preseed "lxd init preseed"
-run_test test_storage_profiles "storage profiles"
-run_test test_container_import "container import"
-run_test test_storage_volume_attach "attaching storage volumes"
-run_test test_storage_driver_ceph "ceph storage driver"
-run_test test_resources "resources"
-run_test test_kernel_limits "kernel limits"
-run_test test_macaroon_auth "macaroon authentication"
-run_test test_console "console"
-run_test test_query "query"
-run_test test_proxy_device "proxy device"
-run_test test_storage_local_volume_handling "storage local volume handling"
-run_test test_backup_import "backup import"
-run_test test_backup_export "backup export"
-run_test test_backup_rename "backup rename"
-run_test test_container_local_cross_pool_handling "container local cross pool handling"
-run_test test_incremental_copy "incremental container copy"
-run_test test_clustering_enable "clustering enable"
-run_test test_clustering_membership "clustering membership"
-run_test test_clustering_containers "clustering containers"
-run_test test_clustering_storage "clustering storage"
-run_test test_clustering_network "clustering network"
-run_test test_clustering_publish "clustering publish"
-run_test test_clustering_profiles "clustering profiles"
-run_test test_clustering_join_api "clustering join api"
-run_test test_clustering_shutdown_nodes "clustering shutdown"
-run_test test_clustering_projects "clustering projects"
-run_test test_clustering_address "clustering address"
-run_test test_clustering_image_replication "clustering image replication"
-#run_test test_clustering_upgrade "clustering upgrade"
+###run_test test_template "file templating"
+###run_test test_pki "PKI mode"
+###run_test test_devlxd "/dev/lxd"
+###run_test test_fuidshift "fuidshift"
+###run_test test_migration "migration"
+###run_test test_fdleak "fd leak"
+###run_test test_storage "storage"
+###run_test test_storage_volume_snapshots "storage volume snapshots"
+###run_test test_init_auto "lxd init auto"
+###run_test test_init_interactive "lxd init interactive"
+###run_test test_init_preseed "lxd init preseed"
+###run_test test_storage_profiles "storage profiles"
+###run_test test_container_import "container import"
+###run_test test_storage_volume_attach "attaching storage volumes"
+###run_test test_storage_driver_ceph "ceph storage driver"
+###run_test test_resources "resources"
+###run_test test_kernel_limits "kernel limits"
+###run_test test_macaroon_auth "macaroon authentication"
+###run_test test_console "console"
+###run_test test_query "query"
+###run_test test_proxy_device "proxy device"
+###run_test test_storage_local_volume_handling "storage local volume handling"
+###run_test test_backup_import "backup import"
+###run_test test_backup_export "backup export"
+###run_test test_backup_rename "backup rename"
+###run_test test_container_local_cross_pool_handling "container local cross pool handling"
+###run_test test_incremental_copy "incremental container copy"
+###run_test test_clustering_enable "clustering enable"
+###run_test test_clustering_membership "clustering membership"
+###run_test test_clustering_containers "clustering containers"
+###run_test test_clustering_storage "clustering storage"
+###run_test test_clustering_network "clustering network"
+###run_test test_clustering_publish "clustering publish"
+###run_test test_clustering_profiles "clustering profiles"
+###run_test test_clustering_join_api "clustering join api"
+###run_test test_clustering_shutdown_nodes "clustering shutdown"
+###run_test test_clustering_projects "clustering projects"
+###run_test test_clustering_address "clustering address"
+###run_test test_clustering_image_replication "clustering image replication"
+####run_test test_clustering_upgrade "clustering upgrade"
 
 # shellcheck disable=SC2034
 TEST_RESULT=success


More information about the lxc-devel mailing list