Skip to content

Conversation

@jkowalski
Copy link
Contributor

@jkowalski jkowalski commented Jan 29, 2022

This allows KopiaUI server to start when the repository directory is not mounted or otherwise unavailable. Connection attempts will be retried indefinitely and user will see new Initializing page.

This also exposes Open and Connect as tasks allowing the user to see logs directly in the UI and cancel the operation.

Fixes #1643

image

@codecov
Copy link

codecov bot commented Jan 29, 2022

Codecov Report

Merging #1691 (e27e281) into master (f67274e) will increase coverage by 0.02%.
The diff coverage is 68.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1691      +/-   ##
==========================================
+ Coverage   70.72%   70.75%   +0.02%     
==========================================
  Files         387      387              
  Lines       30789    30918     +129     
==========================================
+ Hits        21776    21876     +100     
- Misses       7345     7365      +20     
- Partials     1668     1677       +9     
Impacted Files Coverage Δ
internal/server/api_repo.go 39.56% <36.84%> (+0.46%) ⬆️
internal/uitask/uitask_manager.go 92.72% <55.55%> (-7.28%) ⬇️
internal/server/server.go 71.31% <71.79%> (-0.19%) ⬇️
cli/app.go 76.12% <83.33%> (+0.25%) ⬆️
cli/command_server_start.go 78.26% <90.62%> (+4.42%) ⬆️
internal/cache/persistent_lru_cache.go 100.00% <100.00%> (ø)
internal/uitask/uitask.go 100.00% <100.00%> (+2.46%) ⬆️
cli/auto_upgrade.go 58.53% <0.00%> (-7.32%) ⬇️
internal/listcache/listcache.go 79.41% <0.00%> (-3.93%) ⬇️
repo/maintenance/maintenance_schedule.go 66.37% <0.00%> (-2.59%) ⬇️
... and 14 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f67274e...e27e281. Read the comment docs.

This allows KopiaUI server to start when the repository directory
is not mounted or otherwise unavailable. Connection attempts will
be retried indefinitely and user will see new `Initializing` page.

This also exposes `Open` and `Connect` as tasks allowing the user to see
logs directly in the UI and cancel the operation.
@jkowalski jkowalski merged commit fd163cf into kopia:master Jan 30, 2022
jkowalski added a commit to jkowalski/kopia that referenced this pull request Feb 2, 2022
v0.10.3 introduced a regression where RClone connections did not
work in KopiaUI but were ok in the CLI.

The root cause was kopia#1691 which caused storage context to be closed
after opening the repository.

Added test that verifies that storage does not rely on the context
remaining open.
jkowalski added a commit that referenced this pull request Feb 2, 2022
v0.10.3 introduced a regression where RClone connections did not
work in KopiaUI but were ok in the CLI.

The root cause was #1691 which caused storage context to be closed
after opening the repository.

Added test that verifies that storage does not rely on the context
remaining open.
jkowalski added a commit that referenced this pull request Feb 2, 2022
v0.10.3 introduced a regression where RClone connections did not
work in KopiaUI but were ok in the CLI.

The root cause was #1691 which caused storage context to be closed
after opening the repository.

Added test that verifies that storage does not rely on the context
remaining open.
julio-lopez added a commit to julio-lopez/kopia that referenced this pull request Oct 31, 2024
The kopia server never uploads logs to the repository,
because the Context used for uploading the log blobs
is already canceled when the PUT operation is initiated.

The context used for blob uploads is passed to
`repodiag.NewLogManager` when opening the repository.

In the case of the kopia server, the repository is asynchronously
opened in `server.Server.InitReposotoryAsync`. The context
passed to `repo.Open` is canceled after the "open repository"
server task completes. This issue was introduced in kopia#1691

Change:
Use `context.WithoutCancel()` instead of the context passed
when the repo diagnoser is created.
julio-lopez added a commit to kastenhq/kopia that referenced this pull request Jan 22, 2025
The kopia server never uploads logs to the repository,
because the Context used for uploading the log blobs
is already canceled when the PUT operation is initiated.

The context used for blob uploads is passed to
`repodiag.NewLogManager` when opening the repository.

In the case of the kopia server, the repository is asynchronously
opened in `server.Server.InitReposotoryAsync`. The context
passed to `repo.Open` is canceled after the "open repository"
server task completes. This issue was introduced in kopia#1691

Change:
Use `context.WithoutCancel()` instead of the context passed
when the repo diagnoser is created.
julio-lopez added a commit to kastenhq/kopia that referenced this pull request Jan 22, 2025
The kopia server was not uploading any logs to the repository,
because _"repodiag"_ blob uploads would always fail.

The cause was the following:
When the (log) repodiag blob PUT operation was initiated,
the `Context` used for this operation was already canceled.

The context used for blob uploads is passed to
`repodiag.NewLogManager` when opening the repository.
In the case of the kopia server, the repository is asynchronously
opened in `server.Server.InitReposotoryAsync`. The context
passed to `repo.Open` is canceled after the "open repository"
server task completes. This issue was introduced in kopia#1691

Change:
Use `context.WithoutCancel()` instead of the context passed
when the repo diagnoser is created.

New tests are included to reproduce this failure and verify
the fix.
julio-lopez added a commit to kastenhq/kopia that referenced this pull request Jan 22, 2025
The kopia server was not uploading any logs to the repository,
because _"repodiag"_ blob uploads would always fail.

The cause was the following:
When the (log) repodiag blob PUT operation was initiated,
the `Context` used for this operation was already canceled.

The context used for blob uploads is passed to
`repodiag.NewLogManager` when opening the repository.
In the case of the kopia server, the repository is asynchronously
opened in `server.Server.InitReposotoryAsync`. The context
passed to `repo.Open` is canceled after the "open repository"
server task completes. This issue was introduced in kopia#1691

Change:
Use `context.WithoutCancel()` instead of the context passed
when the repo diagnoser is created.

New tests are included to reproduce this failure and verify
the fix.
julio-lopez added a commit that referenced this pull request Jan 23, 2025
The kopia server was not uploading any logs to the repository,
because "repodiag" blob uploads would always fail.

The cause was the following: when the (log) repodiag blob
PUT operation was initiated, the `Context` used for this
operation was already canceled.

The context used for blob uploads is passed to
`repodiag.NewLogManager` when opening the repository.
In the case of the kopia server, the repository is asynchronously
opened in `server.Server.InitReposotoryAsync`. The context
passed to `repo.Open` is canceled after the "open repository"
server task completes.

This issue was introduced in #1691

Change:
Use `context.WithoutCancel()` instead of the context passed
when the repo diagnoser is created.

New tests are included to reproduce this failure and verify
the fix.
- test: ensure server logs are uploaded to the repo
- test: honor cancellation in map storage
- test: repodiag context cancellation

Ref:
- #1691
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kopia UI shows <not connected> for filesystem storage when "network path was not found" on startup

1 participant