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

Fix: port conflict with --debug flag #858

Merged
merged 2 commits into from
Jun 30, 2020
Merged

Fix: port conflict with --debug flag #858

merged 2 commits into from
Jun 30, 2020

Conversation

bojiang
Copy link
Member

@bojiang bojiang commented Jun 30, 2020

Description

Fix: #848

Motivation and Context

When starting flask app with debug flag, it will launch a child process and restart to watch file changes, which spawns another batching server.

ref: https://flask.palletsprojects.com/en/1.1.x/server/#in-code

The reason for this is that due to how the reload mechanism works there are some bizarre side-effects (like executing certain code twice, sometimes crashing without message or dying when a syntax or import error happens).

How Has This Been Tested?

Run locally.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature and improvements (non-breaking change which adds/improves functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Code Refactoring (internal change which is not user facing)
  • Documentation
  • Test, CI, or build

Component(s) if applicable

  • BentoService (service definition, dependency management, API input/output adapters)
  • Model Artifact (model serialization, multi-framework support)
  • Model Server (mico-batching, dockerisation, logging, OpenAPI, instruments)
  • YataiService gRPC server (model registry, cloud deployment automation)
  • YataiService web server (nodejs HTTP server and web UI)
  • Internal (BentoML's own configuration, logging, utility, exception handling)
  • BentoML CLI

Checklist:

  • My code follows the bentoml code style, both ./dev/format.sh and
    ./dev/lint.sh script have passed
    (instructions).
  • My change reduces project test coverage and requires unit tests to be added
  • I have added unit tests covering my code change
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

@codecov
Copy link

codecov bot commented Jun 30, 2020

Codecov Report

Merging #858 into master will increase coverage by 2.46%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #858      +/-   ##
==========================================
+ Coverage   54.76%   57.22%   +2.46%     
==========================================
  Files         120      117       -3     
  Lines        9001     8085     -916     
==========================================
- Hits         4929     4627     -302     
+ Misses       4072     3458     -614     
Impacted Files Coverage Δ
bentoml/marshal/marshal.py 29.57% <0.00%> (-0.21%) ⬇️
bentoml/saved_bundle/templates.py 100.00% <ø> (ø)
bentoml/server/bento_api_server.py 76.64% <0.00%> (ø)
bentoml/utils/cloudpickle.py
bentoml/_version.py
bentoml/adapters/pytorch_tensor_input.py
bentoml/configuration/__init__.py 73.80% <0.00%> (+2.38%) ⬆️
bentoml/saved_bundle/config.py 88.23% <0.00%> (+2.52%) ⬆️

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 f5ee64b...559d05a. Read the comment docs.

@parano parano self-requested a review June 30, 2020 16:40
@parano
Copy link
Member

parano commented Jun 30, 2020

Thanks for fixing this @bojiang!

@parano parano merged commit 2968cbe into bentoml:master Jun 30, 2020
aarnphm pushed a commit to aarnphm/BentoML that referenced this pull request Jul 29, 2022
* Fix: port conflict with --debug flag

* [CI] more accurate test coverage
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.

"OSError address already in use" when running "bentoml serve" with --enable-microbatch
2 participants