Skip to content

Disable race detector so that replica doesn't leak memory #1024

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

Closed
wants to merge 6 commits into from

Conversation

jmorag
Copy link

@jmorag jmorag commented Feb 8, 2021

No description provided.

@jmorag jmorag requested a review from myleshorton February 8, 2021 19:49
@jmorag
Copy link
Author

jmorag commented Feb 8, 2021

Until golang/go#26813 is resolved, running lantern with the race detector causes memory and cpu usage to explode until the machine is rendered unusable.

@anacrolix
Copy link
Contributor

I suspect BUILD_RACE is set to an empty string for production builds, and it's still worthwhile to run tests/staging/dev-local stuff with -race unless it becomes an issue. The BUILD_RACE var is also useful as it's threaded through everything in the Makefile in the right places, so I think it's okay to keep everything here as is? Or at the most, set BUILD_RACE to the empty value by default, so people aren't caught unawares. The last option could be to just disable DHT by default if the race detector is enabled, it's a fairly minor feature at the moment.

@myleshorton
Copy link
Contributor

Oh yeah definitely for production builds we don't use the race flag.

@myleshorton
Copy link
Contributor

I agree we definitely want to use -race for tests -- it's really very useful in general for identifying races, and I think it's existence is actually the main reason it doesn't seem super useful now -- i.e. we've eliminated the races it's flagged for us!

BUILD_RACE ?= '-race'
# The race detector leaks memory so we disable it in testing until
# https://github.com/golang/go/issues/26813 is resolved
# BUILD_RACE ?= '-race'
REVISION_DATE := $(shell git log -1 --pretty=format:%ad --date=format:%Y%m%d.%H%M%S)
BUILD_DATE := $(shell date -u +%Y%m%d.%H%M%S)

ifeq ($(OS),Windows_NT)
Copy link
Contributor

Choose a reason for hiding this comment

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

This check should be done with go env 😆

@anacrolix
Copy link
Contributor

I would keep the comment about how memory might leak for future developers.

@jmorag jmorag force-pushed the disable-race-detector branch from e17bdff to 581f044 Compare April 8, 2021 17:04
@anacrolix
Copy link
Contributor

I think this has been pushed to by accident. It seemed like some of the PR was of interest, the comment, and some of the fixes around -x is that right?

@jmorag
Copy link
Author

jmorag commented Apr 8, 2021 via email

@jmorag
Copy link
Author

jmorag commented Apr 12, 2021

Closing this. For development, we can just build with BUILD_RACE="" set which will solve this problem, at least on my machine.

@jmorag jmorag closed this Apr 12, 2021
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.

3 participants