Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: clean stale provisioner files#9545

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mtojek merged 27 commits intomainfrom7107-clean-stale-files
Sep 11, 2023
Merged

Conversation

@mtojek
Copy link
Member

@mtojekmtojek commentedSep 6, 2023
edited
Loading

Fixes:#7107

This PR introduces cleanup logic for stale provisioner files:

  • unfinished, orphan provisioner sessions
  • unused plugins based on the last "access time" attribute

I tried to implement a really dumb sweeper that doesn't care about the content but wouldn't like to end up with partially removed plugin files, hence the implementation is plugin-aware.

TODO:

  • unit tests forprovisioner/terraform/cleanup.go
  • unit tests forprovisionersdk/cleanup.go

@mtojekmtojek self-assigned thisSep 6, 2023
@mtojekmtojek marked this pull request as ready for reviewSeptember 7, 2023 19:01
tailscale.comv1.46.1
)

requiregithub.com/djherbis/timesv1.5.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It's super annoying that this isn't exposed in the standard library.
I'm slightly concerned that this module doesn't appear to be very active, but it has no dependencies, so maybe that's OK?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I did the self-evaluation of the module, and I agree with you. Fortunately, this is just a basic syscall, so in theory, we could "port" it to coder.

returnerr
}

accessTime:=info.ModTime()// fallback to modTime if accessTime is not available (afero)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Just be aware that modtime is not guaranteed (see:https://www.kernel.org/doc/html/latest/filesystems/api-summary.html?highlight=nocmtime#c.file_update_time)

Howver, I wouldassume it to at least be the time the file was created.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Yes, that is correct. I was thinking about running a self-test on the cache directory, but on the other hand I wouldn't like to overcomplicate things.

@mtojek
Copy link
MemberAuthor

@johnstcn If you don't mind, I will merge this after the weekend to prevent any unexpected issues 👍

@johnstcn
Copy link
Member

@johnstcn If you don't mind, I will merge this after the weekend to prevent any unexpected issues 👍

👍

chmod 444 /proc/sys/days/friday

@mtojekmtojekenabled auto-merge (squash)September 11, 2023 07:30
@mtojekmtojek merged commit67fe3ae intomainSep 11, 2023
@mtojekmtojek deleted the 7107-clean-stale-files branchSeptember 11, 2023 07:37
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsSep 11, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@johnstcnjohnstcnjohnstcn approved these changes

Assignees

@mtojekmtojek

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

clean up coder cache

3 participants

@mtojek@johnstcn

[8]ページ先頭

©2009-2025 Movatter.jp