Skip to content

Conversation

JordiSubira
Copy link
Contributor

This PR tries to remove a Linux-only dependency for running SCION applications of other platforms. The RunsUnDocker() method is the Linux-only call, thus we check whether we are running in Docker only in Linux platform. I am in favor of even removing this log line, supporting @matzf comment on https://reviewable.io/reviews/scionproto/scion/4344#-Nt_IGRG4RbvC-PCVToV.

@matzf
Copy link
Contributor

matzf commented Apr 3, 2024

This change is Reviewable

@matzf matzf changed the title [logging] Removing Linux-Only dependency private/env: avoid RunsInDocker during startup logging on non-Linux platforms Apr 8, 2024
Copy link
Contributor

@matzf matzf left a comment

Choose a reason for hiding this comment

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

Indeeed, I'd propose to remove RunsInDocker entirely; I can't quite see the usefulness of this information.

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @JordiSubira)


private/env/logging.go line 45 at r1 (raw file):

			return serrors.WrapStr("Unable to determine if running in docker", err)
		}
	}

If we do keep the RunsInDocker check, I'd propose to apply the same pattern as the implementation in statuspages.go; attempt to call RunsInDocker and entirely omit the line if the call errors.

Copy link
Contributor Author

@JordiSubira JordiSubira left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @matzf)


private/env/logging.go line 45 at r1 (raw file):

Previously, matzf (Matthias Frei) wrote…

If we do keep the RunsInDocker check, I'd propose to apply the same pattern as the implementation in statuspages.go; attempt to call RunsInDocker and entirely omit the line if the call errors.

Done, after removing it completely.

@matzf matzf requested review from lukedirtwalker and oncilla April 8, 2024 12:28
Copy link
Collaborator

@lukedirtwalker lukedirtwalker left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @matzf and @oncilla)

Copy link
Contributor

@oncilla oncilla left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @matzf)

@matzf matzf changed the title private/env: avoid RunsInDocker during startup logging on non-Linux platforms private/env: remove RunsInDocker during startup log Apr 11, 2024
Copy link
Contributor

@matzf matzf left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @JordiSubira)

@matzf matzf merged commit f9c9639 into scionproto:master Apr 11, 2024
matzf pushed a commit that referenced this pull request Apr 18, 2024
The use of the platform-dependent flag syscall.MSG_WAITFORONE prevents
building the router on platforms other than Linux. This change isolates
this dependency. Behavior on non-Linux platforms will be less efficient
but still semantically correct because ReadBatch will only read a single
message on those platforms anyway.

Together with the previous PR #4499 and the dispatcher removal PR #4344
this set of changes will, e.g., enable running local development
topologies on platforms other than Linux.

Fixes #4046.
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.

4 participants