flask-profiler icon indicating copy to clipboard operation
flask-profiler copied to clipboard

Endpoint call fails, if `flask-profiler` has error

Open amarvin opened this issue 4 years ago • 1 comments

flask-profiler is awesome, nice work! I'm using it with SQLAlchemy and PostgreSQL. Sometimes there are spikes of usage with my app though, and I get this error:

sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) SSL SYSCALL error: EOF detected

which I believe is an error writing the runtime to PostgreSQL occurring when there's many simultaneous database connections. Perhaps flask-profiler could fix this error, by adding a pool_pre_ping=True to the database engine.

Regardless if that error is fixed, I would expect that such an error doesn't also make the endpoint call fail. Couldn't flask-profiler run the "write to database" step in a subprocess that's allowed to fail so that the endpoint can still succeed?

amarvin avatar Nov 12 '21 17:11 amarvin

Oh, pre-ping was added in 0f5468c6fb2b29b45dfc993805cf5256700c6a08. I'll try installing that commit. Would be great to have a new release with that (#114).

amarvin avatar Nov 12 '21 18:11 amarvin