Finalising all rsyncers through the instrument server seems to cause connection issues with the database

Open
#530 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
python, sqlalchemy
Domain
backend, databases

Research direction

Start at multigrid_control.py around line 169 and trace how rsyncer finalisations run outside threads into validate_instrument_server_session_token. Use the reported SQLAlchemy OperationalError as the failure signal; done means finalising all rsyncers no longer causes the database connection to close unexpectedly.

Written by the indexing model from the issue text.

Description

bug web ui

The first error log:

`sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.

[SQL: SELECT session.id, session.name, session.visit, session.started, session.current_gain_ref, session.instrument_name
FROM session
WHERE session.id = %(id_1)s]
[parameters: {'id_1': 22}]
(Background on this error at: https://sqlalche.me/e/20/e3q8)`

occurring in validate_instrument_server_session_token in auth.

The rsyncer finalisatons happen outside of threads (https://github.com/DiamondLightSource/python-murfey/blob/7e412424845eda96abed07165b781f433cc6ad56/src/murfey/client/multigrid_control.py#L169) which may cause issues

Dominant language
Python
Stars
2
Forks
1
Avg merge
1d 12h
Merged PRs (30d)
22

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DiamondLightSource/python-murfey

All issues in DiamondLightSource/python-murfey

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.