Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: some issues in 2.2 #1565

Merged
merged 7 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ jobs:
export NYDUS_NYDUSIFY_$version_export=/usr/bin/nydus-$version/nydusify
done

curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/bin v1.51.2
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/bin v1.57.1
sudo -E make smoke-only

nydus-unit-test:
Expand Down
136 changes: 112 additions & 24 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ indexmap = "1"
lazy_static = "1"
libc = "0.2"
log = "0.4.8"
mio = { version = "0.8", features = ["os-poll", "os-ext"] }
mio = { version = "0.8.11", features = ["os-poll", "os-ext"] }
nix = "0.24.0"
rlimit = "0.9.0"
serde = { version = "1.0.110", features = ["serde_derive", "rc"] }
Expand Down Expand Up @@ -97,4 +97,4 @@ backend-registry = ["nydus-storage/backend-registry"]
backend-s3 = ["nydus-storage/backend-s3"]

[workspace]
members = ["api", "app", "blobfs", "clib", "error", "rafs", "storage", "service", "utils"]
members = ["api", "app", "blobfs", "clib", "error", "rafs", "storage", "service", "utils"]
7 changes: 5 additions & 2 deletions service/src/daemon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,13 +416,16 @@ impl DaemonController {
self.fs_service.lock().unwrap().clone()
}

/// Shutdown all services managed by the controller.
pub fn shutdown(&self) {
/// Notify controller shutdown
pub fn notify_shutdown(&self) {
// Marking exiting state.
self.active.store(false, Ordering::Release);
// Signal the `run_loop()` working thread to exit.
let _ = self.waker.wake();
}

/// Shutdown all services managed by the controller.
pub fn shutdown(&self) {
let daemon = self.daemon.lock().unwrap().take();
if let Some(d) = daemon {
if let Err(e) = d.trigger_stop() {
Expand Down
2 changes: 1 addition & 1 deletion smoke/tests/tool/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,6 @@ func (ctx *Context) PrepareWorkDir(t *testing.T) {
}
}

func (ctx *Context) Destroy(t *testing.T) {
func (ctx *Context) Destroy(_ *testing.T) {
os.RemoveAll(ctx.Env.WorkDir)
}
5 changes: 2 additions & 3 deletions smoke/tests/tool/iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,9 @@ func (c *DescartesIterator) calNext() {
carried = true
cursors[idx]++
break
} else {
carried = false
cursors[idx] = 0
}
carried = false
cursors[idx] = 0
}
if !carried {
c.noNext()
Expand Down
6 changes: 3 additions & 3 deletions smoke/tests/tool/layer.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func (l *Layer) PackRef(t *testing.T, ctx Context, blobDir string, compress bool
return ociBlobDigest, rafsBlobDigest
}

func (l *Layer) Overlay(t *testing.T, upper *Layer) *Layer {
func (l *Layer) Overlay(_ *testing.T, upper *Layer) *Layer {
// Handle whiteout/opaque files
for upperName := range upper.FileTree {
name := filepath.Base(upperName)
Expand Down Expand Up @@ -231,14 +231,14 @@ func (l *Layer) Overlay(t *testing.T, upper *Layer) *Layer {

func (l *Layer) recordFileTree(t *testing.T) {
l.FileTree = map[string]*File{}
filepath.Walk(l.workDir, func(path string, fi os.FileInfo, err error) error {
filepath.Walk(l.workDir, func(path string, _ os.FileInfo, _ error) error {
targetPath := l.TargetPath(t, path)
l.FileTree[targetPath] = NewFile(t, path, targetPath)
return nil
})
}

func (l *Layer) toOCITar(t *testing.T) io.ReadCloser {
func (l *Layer) toOCITar(_ *testing.T) io.ReadCloser {
return archive.Diff(context.Background(), "", l.workDir)
}

Expand Down
2 changes: 1 addition & 1 deletion smoke/tests/tool/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func Verify(t *testing.T, ctx Context, expectedFiles map[string]*File) {
}()

actualFiles := map[string]*File{}
err = filepath.WalkDir(ctx.Env.MountDir, func(path string, entry fs.DirEntry, err error) error {
err = filepath.WalkDir(ctx.Env.MountDir, func(path string, _ fs.DirEntry, err error) error {
require.Nil(t, err)

targetPath, err := filepath.Rel(ctx.Env.MountDir, path)
Expand Down
Loading
Loading