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

Fixes a race condition with multiple simultaneous get requests. #1807

Merged
merged 5 commits into from
Sep 8, 2022

Conversation

KyuubiYoru
Copy link
Contributor

This fixes an issue where, if you make multiple requests at the same time, the results will sound corrupted or you will get an internal server error.

@CLAassistant
Copy link

CLAassistant commented Jul 31, 2022

CLA assistant check
All committers have signed the CLA.

@erogol
Copy link
Member

erogol commented Aug 1, 2022

Thanks for ✨PR✨

I see there are style issues. If you fix, I can merge this PR

@KyuubiYoru
Copy link
Contributor Author

I'm not sure how i can fix this error.
TTS/server/server.py:174:4: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
i'm doing lock.acquire() in this line.

@WeberJulian
Copy link
Contributor

I'm not sure how i can fix this error. TTS/server/server.py:174:4: R1732: Consider using 'with' for resource-allocating operations (consider-using-with) i'm doing lock.acquire() in this line.

I think the formatter prefers the with notation:

lock = Lock()
@app.route("/api/tts", methods=["GET"])
def tts():
    with lock:
        text = request.args.get("text")
        ...

rather than that:

lock = Lock()
@app.route("/api/tts", methods=["GET"])
def tts():
    lock.acquire()
    text = request.args.get("text")
    ...
    lock.release()

@KyuubiYoru
Copy link
Contributor Author

Reformatted the file i changed failed this time?

black tests TTS notebooks recipes --check
Skipping .ipynb files as Jupyter dependencies are not installed.
You can fix this by running ``pip install black[jupyter]``
would reformat TTS/server/server.py

Oh no! 💥 💔 💥
1 file would be reformatted, 298 files would be left unchanged.
make: *** [Makefile:47: lint] Error 1
Error: Process completed with exit code 2.

@stale
Copy link

stale bot commented Sep 6, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You might also look our discussion channels.

@stale stale bot added the wontfix This will not be worked on but feel free to help. label Sep 6, 2022
@stale stale bot removed the wontfix This will not be worked on but feel free to help. label Sep 7, 2022
@erogol erogol merged commit 3b7dff5 into coqui-ai:dev Sep 8, 2022
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