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

Reuse open connection, fix #920 #1106

Closed
wants to merge 1 commit into from

Conversation

fl42
Copy link

@fl42 fl42 commented May 15, 2021

Hello,

This PR it's an attempt to fix #920
What is your opinion on the fix?

As the problem appears randomly, I don't know if this fix totally solves it.

EDIT: it runs for few days without any issue of my side

@blakeblackshear
Copy link
Owner

I think the proper fix is described here. This issue started after adding gevent to handle websockets.

@fl42
Copy link
Author

fl42 commented May 27, 2021

I'm not a big fan of monkeypatching the thread module but...I agree that sharing connections between threads is not the best option too

I'm considering rewriting the WS part (or event the full API) using FastAPI
Would you accept such a big refactoring @blakeblackshear?

@blakeblackshear
Copy link
Owner

I don't know much about fastapi, but yes. I am not sure how it will impact the other parts of frigate given you must start it with uvicorn.

@fl42
Copy link
Author

fl42 commented May 27, 2021

Ok I'll try on my side

@b3nj1
Copy link

b3nj1 commented Jun 10, 2021

FWIW, I this PR also fixed the issue on my side. Further, it seems to have reduced the load on the server by something like 50-60%!!
Is there a reason that it's not safe to re-use the connection as in this PR?

  • Benjamin

@blakeblackshear
Copy link
Owner

I'm not sure why it would change the server load. I plan to address this in a different way for the next release.

@fl42
Copy link
Author

fl42 commented Jun 12, 2021

@blakeblackshear Would you consider merging this fix with a patch release bump? (before the proper fix in 0.9.0)
The bug is quite annoying when the API is heavy loaded (e.g., when Home Assistant copy snapshot on event)

@blakeblackshear
Copy link
Owner

No. I don't plan to solve it this way.

@stale
Copy link

stale bot commented Jul 12, 2021

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.

@stale stale bot added the stale label Jul 12, 2021
@stale stale bot closed this Jul 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Connection already opened
3 participants