ivlovric / HFP

HEP Fidelity Proxy
15 stars 7 forks source link

Copy to FILE error? #7

Closed khorsmann closed 2 years ago

khorsmann commented 2 years ago

Hi,

thanks for this great project. Did i forget something? The Copy to FILE error happens - and i am unsure if its "okay" or its an issue. The Code shows that the file should reported (is it the HFP/HEP-saved.arch) ?

Dec 06 14:25:10  HFP[81569]: 2021/12/06 14:25:10 -->X||Read IN packets error: EOF
Dec 06 14:25:10  HFP[81569]: 2021/12/06 14:25:10 -->|| New connection from 172.24.32.17:51560
Dec 06 14:25:10  HFP[81569]: 2021/12/06 14:25:10 ||--> Connected OUT 172.16.32.26:9062
Dec 06 14:45:06  HFP[81569]: 2021/12/06 14:45:06 ||--> Sending HEP OUT error: write tcp4 172.24.32.29:53632->172.16.32.26:9062: write: connection reset by peer
Dec 06 14:45:06  HFP[81569]: Copy to FILE error
Dec 06 14:45:06  HFP[81569]: read tcp4 172.24.32.29:9062->172.24.32.17:51560: use of closed network connection
Dec 06 14:50:34  HFP[81569]: 2021/12/06 14:50:34 -->|| New connection from 172.24.32.17:52816
Dec 06 14:50:34  HFP[81569]: 2021/12/06 14:50:34 ||--> Connected OUT 172.16.32.26:9062
Dec 06 18:28:58  HFP[81569]: 2021/12/06 18:28:58 -->X||Read IN packets error: EOF
Dec 06 18:28:58  HFP[81569]: 2021/12/06 18:28:58 -->|| New connection from 172.24.32.17:35432
Dec 06 18:28:58  HFP[81569]: 2021/12/06 18:28:58 ||--> Connected OUT 172.16.32.26:9062`

Systemd Service File

[Unit]
Description=HEP Fidelity Proxy - Forward or Store HEP Messages to HOMER/HEPIC
After=network.target

[Service]
WorkingDirectory=/var/lib/hfp
ExecStart=/usr/local/bin/HFP -d "off" -l ":9062" -r "my.hepic.server:9062"
ExecStop=/bin/kill ${MAINPID}
Restart=on-failure
RestartSec=10s
User=hfp
Type=simple

[Install]
WantedBy=multi-user.target
ivlovric commented 2 years ago

Hi, @khorsmann

We are aware of this, let me explain what does it mean. It is ONE packet that is stuck in "limbo" after it arrived to HFP input tcp buffer and when at almost the same time outbound connection to Hepic/Homer gets broken. So we are talking about milliseconds in time frame. Since I am not able to solve this myself, I will be grateful if any contributor can help here. :) Until then, I will give my best and dedicate more time to solve this fully. It is not concerning but since I want it to be fully reliable I want even this one limbo packet to be sent to backend HEP server.

Systemd file look good, its nice to see services running as restricted user instead of root so good job there. And yes, HEP saved locally in cases of backend downtime should be saved in HEP/HEP-saved.arch

ivlovric commented 2 years ago

Please try latest master commit https://github.com/ivlovric/HFP/commit/e2a2a561f163f84e3fae43cc37b985ae84ce6858 This edge case should be fixed.

Thanks, I

khorsmann commented 2 years ago

Hi Ivica,

i test 0.5 and will come back with an short report and re-open this case if needed. Thanks for your work, Regards - Karsten