Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uTP calls returnContent twice #438

Open
acolytec3 opened this issue Aug 15, 2023 · 1 comment
Open

uTP calls returnContent twice #438

acolytec3 opened this issue Aug 15, 2023 · 1 comment

Comments

@acolytec3
Copy link
Collaborator

When a uTP content stream wraps up, it appears that we call returnContent twice, either because the sending node is sending 2 FIN packets or the FIN packet handler is being called more than once.

7c20:Portal:uTP:RECEIVED:ST_STATE || seqNr: 2164     || +0ms
  f7c20:Portal:uTP:RECEIVED:ST_STATE || ackNr: 2162     || +0ms
  f7c20:Portal:uTP:writeSocket:17440 AckNr's received (50/51): 2113...2160,2161,2162 +2ms
  f7c20:Portal:uTP:writeSocket:17440 AckNr's needed (1/51): 2163
  f7c20:Portal:uTP:writeSocket:17440          +0ms
  f7c20:Portal:uTP:writeSocket:17440:WRITING Sending ST_FIN packet. +2ms
  f7c20:Portal:uTP:writeSocket:17440:SEND:ST_FIN || pktId: 17440 +0ms
  f7c20:Portal:uTP:writeSocket:17440:SEND:ST_FIN || seqNr: 2163 +0ms
  f7c20:Portal:uTP:writeSocket:17440:SEND:ST_FIN || ackNr: 2113 +0ms
  8a470:Portal:uTP:RECEIVED:ST_FIN || pktId: 17440     || +0ms
  8a470:Portal:uTP:RECEIVED:ST_FIN || seqNr: 2163     || +0ms
  8a470:Portal:uTP:RECEIVED:ST_FIN || ackNr: 2113     || +0ms
  8a470:Portal:uTP:readSocket:17441 Connection State: GotFin: 2163 +1ms
  8a470:Portal:uTP:readSocket:17441 all data packets received. +0ms
  8a470:Portal:uTP:readSocket:17441 Packet payloads compiled into 25619 bytes.  Sending FIN-ACK +1ms
  8a470:Portal:uTP:readSocket:17441:SEND:ST_STATE || pktId: 17441 +0ms
  8a470:Portal:uTP:readSocket:17441:SEND:ST_STATE || seqNr: 2165 +0ms
  8a470:Portal:uTP:readSocket:17441:SEND:ST_STATE || ackNr: 2163 +0ms
  8a470:Portal:uTP Decompressing stream into 1 pieces of content +76ms
  8a470:Portal:uTP:FINISHED 1/1 -- (25619 bytes) sending BlockHeader to database +0ms
  8a470:Portal:uTP:RECEIVED:ST_FIN || pktId: 17440     || +0ms
  8a470:Portal:uTP:RECEIVED:ST_FIN || seqNr: 2163     || +0ms
  8a470:Portal:uTP:RECEIVED:ST_FIN || ackNr: 2113     || +0ms
  8a470:Portal:uTP:readSocket:17441 Connection State: GotFin: 2163 +5ms
  8a470:Portal:uTP Decompressing stream into 1 pieces of content +5s
  8a470:Portal:uTP:FINISHED 1/1 -- (0 bytes) sending BlockHeader to database +0ms
  8a470:Portal:uTP:FINISHED Missing content... +0ms

We should investigate and ensure this duplicate action doesn't occur.

@acolytec3
Copy link
Collaborator Author

This is still happening and the logging is weird.

We need something in the handleFinPacket method that closes the socket so if we get a dup FIN packet we don't call returnContent a second time. Seems like both Trin and Fluffy do funny things with sending FIN packets and it clutters up the logs with nonsensical stuff like above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant