Skip to content
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

Check if port/socket is available before forking in Streaming API #9023

Merged
merged 1 commit into from Oct 20, 2018

Conversation

@Gargron
Copy link
Member

commented Oct 19, 2018

Previously, the server would attempt taking port/socket in worker process, and if it was taken, fail, which made the master process create a new worker. This led to really high CPU usage if the
streaming API was started when the port or socket were not available.

Now, before clustering (forking) into worker processes, a test server is created and then removed to check if it can be done.

Resolve #8978

Check if port/socket is available before forking in Streaming API
Previously, the server would attempt taking port/socket in worker
process, and if it was taken, fail, which made the master process
create a new worker. This led to really high CPU usage if the
streaming API was started when the port or socket were not
available.

Now, before clustering (forking) into worker processes, a test
server is created and then removed to check if it can be done.

@Gargron Gargron added the deployment label Oct 19, 2018

@ykzts
ykzts approved these changes Oct 20, 2018

@Gargron Gargron merged commit 369cc5f into master Oct 20, 2018

11 checks passed

ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: check-i18n Your tests passed on CircleCI!
Details
ci/circleci: install Your tests passed on CircleCI!
Details
ci/circleci: install-ruby2.3 Your tests passed on CircleCI!
Details
ci/circleci: install-ruby2.4 Your tests passed on CircleCI!
Details
ci/circleci: install-ruby2.5 Your tests passed on CircleCI!
Details
ci/circleci: test-ruby2.3 Your tests passed on CircleCI!
Details
ci/circleci: test-ruby2.4 Your tests passed on CircleCI!
Details
ci/circleci: test-ruby2.5 Your tests passed on CircleCI!
Details
ci/circleci: test-webui Your tests passed on CircleCI!
Details
codeclimate All good!
Details

@Gargron Gargron deleted the feature-streaming-fail-fast branch Oct 20, 2018

cyber-gene added a commit to ikebuku-ro/mastodon that referenced this pull request Oct 21, 2018
Merge branch 'master' into production
* master: (215 commits)
  Bump version to 2.6.0rc1 (tootsuite#9025)
  fix: Execute PAM authentication tests on CircleCI (tootsuite#9029)
  Add option to block reports from domain (tootsuite#8830)
  Do not test PAM authentication by default (tootsuite#9027)
  Add "disable" button to report screen (tootsuite#9024)
  Check if port/socket is available before forking in Streaming API (tootsuite#9023)
  Redesign direct messages column (tootsuite#9022)
  RTL: fix preferences layout (tootsuite#9021)
  Fix admin account avatar margin (tootsuite#9020)
  Bump strong_migrations from 0.3.0 to 0.3.1 (tootsuite#9015)
  Improve README (tootsuite#9012)
  Update CONTRIBUTING.md (tootsuite#9014)
  Bump tzinfo-data from 1.2018.5 to 1.2018.6 (tootsuite#9016)
  RTL: fix user stats in about page (tootsuite#9018)
  Add unread indicator to conversations (tootsuite#9009)
  fix: initial state of PrivacyDropdown is should not be null (tootsuite#9008)
  Use Ruby ==2.5.2== 2.5.3 (tootsuite#9003)
  RTL: fix domain append at signup form (tootsuite#9007)
  Fix fav/boosts hotkeys not working on detailed statuses (tootsuite#9006)
  RTL: fix admin account margins in about page (tootsuite#9005)
  ...

# Conflicts:
#	CHANGELOG.md
#	Gemfile.lock
#	app/lib/activitypub/activity/create.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.