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

fix: fix 'write EPIPE' error & failing discovery test #328

Merged
merged 13 commits into from
Oct 20, 2023

Conversation

gmaclennan
Copy link
Member

@gmaclennan gmaclennan commented Oct 5, 2023

Docs on this error:

EPIPE (Broken pipe): A write on a pipe, socket, or FIFO for which
there is no process to read the data. Commonly encountered at the net
and http layers, indicative that the remote side of the stream being
written to has been closed.

This is happening when we close the connection but there is not yet an
error handler on the socket. It's ok to ignore - so far as the consumer
is concerned we haven't connected yet.

Turns out the other errors seen with discovery were due to not leaving enough delay before checking deduplication of incoming connections. The sodium-native upgrade to v4.0.4 seemed to highlight this because something is slower. It was hard to diagnose because tests were not failing on my (fast) macbook pro.

Also added catching of errors in tests which can happen when connections are deduplicated.

This PR also includes the update to sodium-native@4.0.4, so #338 is no longer needed if this is merged.

Docs on this error:

> EPIPE (Broken pipe): A write on a pipe, socket, or FIFO for which
> there is no process to read the data. Commonly encountered at the net
> and http layers, indicative that the remote side of the stream being
> written to has been closed.

This is happening when we close the connection but there is not yet an
error handler on the socket. It's ok to ignore - so far as the consumer
is concerned we haven't connected yet.
@gmaclennan gmaclennan self-assigned this Oct 5, 2023
@gmaclennan gmaclennan marked this pull request as draft October 5, 2023 15:43
* main:
  feat: NamespaceSyncState improvements (#339)
  chore: update better-sqlite3 to 8.7.0 (#337)
  chore: update @mapeo/crypto to latest (#336)
  fix: write own device info when creating and adding projects (#297)
  Feat: add DataStore.writeRaw method (#334)
  feat: Add NamespaceSyncState (#313)
  chore: run CI on PRs against any branch (#330)
  feat: add capabilities.getAll() (#326)
@gmaclennan gmaclennan changed the title fix: fix 'write EPIPE' error fix: fix 'write EPIPE' error & failing discovery test Oct 20, 2023
@gmaclennan gmaclennan marked this pull request as ready for review October 20, 2023 08:25
Copy link
Member

@achou11 achou11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking forward to reduced flakiness 👍

@gmaclennan gmaclennan merged commit 5e09b04 into main Oct 20, 2023
7 checks passed
gmaclennan added a commit that referenced this pull request Oct 22, 2023
* main:
  fix: fix 'write EPIPE' error & failing discovery test (#328)
gmaclennan added a commit that referenced this pull request Oct 22, 2023
* main:
  fix: pin pre-releases to exact version (#344)
  fix: fix 'write EPIPE' error & failing discovery test (#328)
  feat: NamespaceSyncState improvements (#339)
@gmaclennan gmaclennan deleted the fix/mdns-socket-error branch October 26, 2023 02:01
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

Successfully merging this pull request may close these issues.

2 participants