Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Is offline mode really offline? #3177

Closed
LorenzoBettini opened this issue Dec 7, 2023 · 10 comments
Closed

Is offline mode really offline? #3177

LorenzoBettini opened this issue Dec 7, 2023 · 10 comments

Comments

@LorenzoBettini
Copy link
Contributor

I've just migrated to Tycho 4.0.4 and in my GitHub Actions workflow, when I get a cache hit, I set the Maven option --offline. I the log I can see

[INFO] ### Using TychoRepositoryTransport for remote P2 access ###
[INFO]     Cache location:         /home/runner/.m2/repository/.cache/tycho
[INFO]     Transport mode:         offline
[INFO]     Http Transport type:    Java11Client
[INFO]     Update mode:            forced

So it's being offline, but then I can see

[INFO] Downloading from p2: https://download.eclipse.org/releases/2023-12/p2.index
[INFO] Downloaded from p2: https://download.eclipse.org/releases/2023-12/p2.index (122 bytes at 0 bytes/s)
[INFO] Downloading from p2: https://download.eclipse.org/technology/epp/packages/2023-12/p2.index
...

So it looks like it's not really offline?
Am I missing something? Or is it the expected behavior?

thanks in advance

@laeubi
Copy link
Member

laeubi commented Dec 7, 2023

The message is printed independently, offline only means that the CacheManager will always use a cached file and never try to contact a remote. In online mode it will depending on the cache state maybe contact a remote if data is not already in the cache, outdated or update is forced.

@LorenzoBettini
Copy link
Contributor Author

So, why does it contact update sites for p2.index (I see there's forced). Is there a way to have a pure offline mode?

@laeubi
Copy link
Member

laeubi commented Dec 7, 2023

So, why does it contact update sites for p2.index (I see there's forced). Is there a way to have a pure offline mode?

What do you mean by "forced"? All files (including p2.index) are cached (or could be at least) so it heavily depends on where you see the message and how you determine that it is not cached already.

@LorenzoBettini
Copy link
Contributor Author

If you see above it says "update mode: forced".

In general, I was asking if there's a way to have a full offline mode, where no remote site is contacted (like maven offline mode).

@laeubi
Copy link
Member

laeubi commented Dec 8, 2023

If you see above it says "update mode: forced".

That's a different topic, and cause because you passing -U to maven what forces Tycho (+Maven) to not rely on the cached state but ask the server for updates what is a bit contradicting to be combined with --offline (both in maven and Tycho).

Regardless of that if you see "Downloading from p2" this does not imply the server is really contacted physically.

@LorenzoBettini
Copy link
Contributor Author

You're right about -U: I though I removed them all but a few of them remained. I now removed them all and I can see Update mode: cache first. Sorry about that!

I still see downloading the p2.index. I can also see

[INFO] Downloading from p2: https://download.eclipse.org/releases/2023-12/p2.index
[INFO] Downloaded from p2: https://download.eclipse.org/releases/2023-12/p2.index (122 bytes at 0 bytes/s)
...
[INFO] Downloading from p2: https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/release/4.30.0/p2.index
[INFO] Downloaded from p2: https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/release/4.30.0/p2.index (172 bytes at 167 KB/s)

So, unless the INFO message is misleading it looks like the server is really contacted physically. Or can I assume it is not contacted?

@laeubi
Copy link
Member

laeubi commented Dec 8, 2023

I still see downloading the p2.index. I can also see

How do you "see" downloads?

So, unless the INFO message is misleading it looks like the server is really contacted physically. Or can I assume it is not contacted?

As said if you specify --offline it will fail when the item is not from cache.

@laeubi
Copy link
Member

laeubi commented Dec 8, 2023

By the way if you think message should be suppressed in offline we can certainly do that, just propose a PR for that.

@LorenzoBettini
Copy link
Contributor Author

I still see downloading the p2.index. I can also see

How do you "see" downloads?

See the end of the second line:

[INFO] Downloading from p2: https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/release/4.30.0/p2.index
[INFO] Downloaded from p2: https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/release/4.30.0/p2.index (172 bytes at 167 KB/s)

The (172 bytes at 167 KB/s) looks like it downloaded something...

So, unless the INFO message is misleading it looks like the server is really contacted physically. Or can I assume it is not contacted?

As said if you specify --offline it will fail when the item is not from cache.

I was thinking of Maven behavior when offline: of course it fails as you said, but it does not even try to establish a network connection. The INFO message above seems to imply a network connection.

@laeubi
Copy link
Member

laeubi commented Dec 8, 2023

Best is to try locally with real offline and pass -e then one an see the offending part much easier than to guess from log lines.

@eclipse-tycho eclipse-tycho locked and limited conversation to collaborators Dec 10, 2023
@laeubi laeubi converted this issue into discussion #3205 Dec 10, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants