Commit Graph

19 Commits

Author SHA1 Message Date
David Glasser
4079c2276f ServiceConnection directly loads ddp
Caching works fine here.
2014-11-07 16:45:58 -08:00
David Glasser
170c0acad7 Rename unibuild everywhere to isopackets 2014-11-07 16:45:58 -08:00
David Glasser
e22702be45 Make more DDP errors specific
These errors should look like connection errors, not clean closes:

- Heartbeat timeout (DDP-level or SockJS-level)
- Connection timeout (SockJS implementation)

The "disconnected with no error while waiting for something we asked
for" error in ServiceConnection is now a DDP.ConnectionError so that it
prints better.

If a command refuses to run due to a catalog sync error, it should print
the error. (Commands that merely warn that they could not sync don't
print that error, unless METEOR_LOG=debug.)
2014-10-20 15:04:12 -07:00
David Glasser
98429c2338 Increase ServiceConnection handshake timeout
Hopefully helps #2777.
2014-10-15 18:08:20 -07:00
David Glasser
3c1c786293 disable client->server heartbeats for troposphere
Addresses #2789.
2014-10-15 17:00:46 -07:00
ekatek
856110c4ce when talking to the package server, try to reconnect 2014-09-14 17:02:36 -07:00
Sashko Stubailo
3189a364e9 Rename livedata to ddp, meteor test-packages passes 2014-08-28 12:53:34 -07:00
David Glasser
fceacf2885 Use 15-second timeout for service connections
This should reduce failures to send package stats.
2014-08-19 12:41:00 -07:00
David Glasser
9054effdeb Fix ServiceConnection DDP negotiation
Now ServiceConnection's guarantee is that once a DDP connection is
successfully negotiated, it won't restart. This relies on the assumption
that the only use of reconnect({_force: true}) is DDP protocol
negotiation!

Drop some unnecessary (and flawed, for this application) `disconnect`
stream events.

Also, remove some unnecessary `new` calls.

Fixes 'meteor mongo some-galaxy app'.
2014-08-18 17:09:04 -07:00
David Glasser
3b3e8d7b93 Simplify ServiceConnection.
- ServiceConnection should never try to reconnect. It's already the case
  that we don't hold open ServiceConnections over long periods while
  idle; it makes the class much simpler if it corresponds to a single
  TCP connection. This also means that as soon as we have one connection
  failure (eg you're offline) we can fail instantly instead of retrying
  pointlessly.

- Drop the explicit timeout code in ServiceConnection. There's already
  timeout handling in stream_client, and now that we don't retry, it
  actually takes effect.

- Be more rigorous about uses of Future in ServiceConnection. Ensure
  that each Future is only used once (ie, avoid "Future resolved more
  than once" errors).  Hopefully fixes #2390.

- ServiceConnection constructor now blocks until it's connected (and
  throws if there's a connection failure).  Maybe this introduces a tiny
  bit more latency to the connection, but it makes it much easier to
  handle errors properly.

- In packageClient.handlePackageServerConnectionError, show the error
  message corresponding to the connection failure.

- In Node, the (newish) error passed to the Stream callback is now a
  "DDP.ConnectionError" object. We can detect this in the tool (and we
  don't even need to do some complex uniload/instanceof dance, since
  error classes made with Meteor.makeErrorType label themselves with a
  string errorType).  We also no longer have a special
  ServiceConnection.ConnectionTimeoutError.
2014-08-17 21:34:57 -07:00
Avital Oliver
600ae65304 Don't print errors on stream level failures, and a little reorg
In particular, this becomes especially important with packaging
since we ping the server with a DDP connection every time you
run an app. Multiple times actually.

So now there's no ECONN error messages printed
2014-06-16 16:33:07 -07:00
David Glasser
dce4307dd1 add XXX comment about serviceconnection timeout 2014-06-16 14:49:13 -07:00
Emily Stark
6f637b6b47 Fix service connection timeout error initialization 2014-06-16 14:28:29 -07:00
David Glasser
7e2b8fc33b updating the latest symlink now works 2014-06-03 17:19:28 -07:00
Emily Stark
81ece3d76a Fix ServiceConfiguration -> ServiceConnection 2014-05-13 15:08:57 -07:00
Avital Oliver
d51da1bdd1 Improve ServiceConnection.ConnectionTimeoutError
Now even though it's initialized lazily, running
`foo instanceof ServiceConnection.ConnectionTimeoutError` before
it's initialized won't throw an error.
2014-05-13 15:04:12 -07:00
Avital Oliver
5d67910ce8 Reveal error name on ServiceConnection.ConnectionTimeoutError stack traces
Prior to this commit, it just displayed [object Object].

This change uses Meteor.makeErrorType from the 'meteor' package which
goes through exactly the right set of hoops.
2014-05-12 16:24:04 -07:00
Emily Stark
06e4f062b9 Add ServiceConnection.apply 2014-03-26 14:43:17 -07:00
Emily Stark
4368309b3f Factor out ServiceConnection 2014-03-25 10:04:42 -07:00