Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

dbserver: handle 2 moxa entries in registry with the same name

Aperta
#440 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python
Ambito
backend, database

Direzione di ricerca

Inizia da database_server.py, nella costruzione di MoxaData, e segui le chiamate a update_mappings e insert_mappings in moxa_data.py. Riproduci il caso del registro con due Moxa che condividono un hostname ma usano IP diversi, quindi verifica che il database server segnali chiaramente il conflitto dell’hostname invece di esporre solo l’errore di voce duplicata.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

I would like the database server to fail with a more readable message than:

Traceback (most recent call last):
  File "C:\Instrument\Apps\EPICS\ISIS\inst_servers\master\DatabaseServer\database_server.py", line 452, in <module>
    moxa_data = MoxaData(
                ^^^^^^^^^
  File "C:\Instrument\Apps\EPICS\ISIS\inst_servers\master\DatabaseServer\moxa_data.py", line 124, in __init__
    self.update_mappings()
  File "C:\Instrument\Apps\EPICS\ISIS\inst_servers\master\DatabaseServer\moxa_data.py", line 138, in update_mappings
    self._moxa_data_source.insert_mappings(*self._get_mappings())
  File "C:\Instrument\Apps\EPICS\ISIS\inst_servers\master\DatabaseServer\moxa_data.py", line 104, in insert_mappings
    self.mysql_abstraction_layer.update(
  File "C:\Instrument\Apps\Python3\Lib\site-packages\genie_python\mysql_abstraction_layer.py", line 94, in update
    self._execute_command(command, False, bound_variables)
  File "C:\Instrument\Apps\Python3\Lib\site-packages\genie_python\mysql_abstraction_layer.py", line 199, in _execute_command
    raise DatabaseError(str(err))
genie_python.mysql_abstraction_layer.DatabaseError: 1062 (23000): Duplicate entry 'MOXA_SELAB2.isis.cclrc.ac.uk-1' for key 'port_mappings.PRIMARY'

when it finds two moxas with different IPs but the same hostname in the registry. I don't think it should still work, it just needs to catch the error and make it more clear what's actually going on.

acceptance criteria
  • if i have two moxas in the registry with the same hostname but a different IP, the database server whinges but makes it clear what is actually wrong.
Lingua principale
Python
Stelle
2
Fork
3
Merge medio
3g 7h
PR unite (30g)
1

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ISISComputingGroup/EPICS-inst_servers

Tutte le issue di ISISComputingGroup/EPICS-inst_servers

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.