flask-profiler
flask-profiler copied to clipboard
Endpoint call fails, if `flask-profiler` has error
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?
Oh, pre-ping was added in 0f5468c6fb2b29b45dfc993805cf5256700c6a08. I'll try installing that commit. Would be great to have a new release with that (#114).