Commit graph

436 commits

Author SHA1 Message Date
Jakob Ackermann
1095851dfe [misc] test/unit: fix typos and assertion of error messages
Sinon does not check the contents of the passed error when checked via
 sinon.stub().calledWith.
```
callback = sinon.stub()
callback(new Error("some message"))
  .calledWith(new Error("completely different message"))
  === true
```

Cherry-pick plus an additional patch for the joinProject bail-out.
(cherry picked from commit d9570fee70701a5f431c39fdbec5f8bc5a7843fe)
2020-05-15 14:46:05 +02:00
Jakob Ackermann
17d04b9041 [misc] bump sinon to 2.x for promise support with stubs
(cherry picked from commit 3c92b937f9430175d7c51660e03c507635448e88)
2020-05-15 12:01:22 +02:00
Jakob Ackermann
b713beb7f0 Merge pull request #135 from overleaf/jpa-skip-leave-project-for-invalid-clients
[WebsocketController] skip leaveProject when joinProject didn't complete
2020-05-13 15:34:41 +02:00
Jakob Ackermann
df9d8ccbbe Merge pull request #134 from overleaf/jpa-handle-redis-subscribe-error-on-join-project
[WebsocketController] handle redis subscribe error on joinProject
2020-05-13 15:34:17 +02:00
Jakob Ackermann
55af5e502f [WebsocketController] skip leaveProject when joinProject didn't complete
Also drop dead code:
 - user_id bailout

   There is a check on a completed joinProject call now. It will always
    set a user_id, see Router.coffee which has a fallback `{_id:"..."}`.

 - late project_id bailout

   WebsocketLoadBalancer.emitToRoom will not work without a project_id.
   We have to bail out before the call.
2020-05-12 17:15:08 +02:00
Jakob Ackermann
684cb3903c [WebsocketController] handle redis subscribe error on joinProject
joinProject should not complete when the redis pub/sub subscribe request
 failed.
2020-05-12 13:03:50 +02:00
Brian Gough
f4b17ebbad Merge pull request #125 from overleaf/bg-add-queue-metrics
add metric for pendingUpdates queue
2020-04-07 11:56:58 +01:00
Brian Gough
5c28da1031 add metric for pendingUpdates queue 2020-04-07 11:53:54 +01:00
Brian Gough
d4d7f4ed68 Merge pull request #122 from overleaf/jpa-pub-sub-metrics
[misc] track redis pub/sub payload sizes on publish
2020-04-07 11:49:57 +01:00
Brian Gough
5765884f38 Merge branch 'master' into jpa-pub-sub-metrics 2020-04-07 11:46:23 +01:00
Henry Oswald
4bd11613dd Merge pull request #124 from overleaf/ho-redis-1-0-12
bump redis to 1.0.12
2020-04-01 08:16:51 +01:00
Henry Oswald
8711abdb66 bump redis to 1.0.12 2020-03-31 14:04:33 +01:00
Jakob Ackermann
56628a16c6 [misc] track redis pub/sub payload sizes on publish 2020-03-30 11:31:44 +02:00
Jakob Ackermann
a9b8e9be3b [misc] upgrade metrics-sharelatex to 2.6.2 2020-03-30 10:47:01 +02:00
Jakob Ackermann
c72633a162 Merge pull request #120 from overleaf/jpa-limit-update-size
[misc] limit update size
2020-03-24 17:04:05 +01:00
Jakob Ackermann
69569e3571 [misc] config: add headroom for JSON serialization in maxUpdateSize 2020-03-24 16:21:29 +01:00
Jakob Ackermann
af53d3b603 [misc] skip duplicate JSON serialization for size check 2020-03-24 11:22:28 +01:00
Jakob Ackermann
cb675d38c2 [misc] SafeJsonParse: align the size limit with the frontend->rt limit
frontend -> real-time and doc-updater -> real-time should be in sync.
Otherwise we can send a payload to doc-updater, but can not receive the
 confirmation of it -- and the client will send it again in a loop.

Also log the size of the payload.
2020-03-24 09:14:15 +01:00
Jakob Ackermann
15244a54be [misc] WebsocketController: limit the update size to 7mb
bail out early on -- especially do not push the update into redis for
 doc-updater to discard it.

Confirm the update silently, otherwise the frontend will send it again.
Broadcast a 'otUpdateError' message and disconnect the client, like
 doc-updater would do.
2020-03-24 09:12:12 +01:00
Jakob Ackermann
7321e80b1e Merge pull request #119 from overleaf/jpa-delay-shutdown
[misc] let proxys observe an upcoming shutdown before starting to drain
2020-03-23 12:56:05 +01:00
Jakob Ackermann
d320c2d5f3 [misc] let proxys observe an upcoming shutdown before starting to drain
Otherwise clients may be routed to the same pod upon reconnecting.
2020-03-17 16:41:48 +01:00
Jakob Ackermann
2b1c5bf436 Merge pull request #100 from overleaf/jpa-dependencies-cleanup
[misc] cleanup dependencies
2020-02-14 10:56:11 +01:00
Jakob Ackermann
600461b90b Merge pull request #99 from overleaf/bg-remove-travis-yml
Remove unused .travis.yml file
2020-02-14 10:55:10 +01:00
Jakob Ackermann
43013e0820 [misc] cleanup unused dependency on mongo 2020-02-12 14:44:01 +01:00
Jakob Ackermann
902b4fca46 [misc] rename npm-shrinkwrap.json to package-lock.json and run npm i 2020-02-12 14:39:53 +01:00
Brian Gough
1ad8315437 remove unused .travis.yml file 2020-02-12 12:37:00 +00:00
Jakob Ackermann
b6be810d52 Merge pull request #98 from overleaf/jpa-build-scripts-1-3-5
[misc] update the build scripts to 1.3.5
2020-02-12 13:23:15 +01:00
Jakob Ackermann
24d46e9d4b [misc] update the build scripts to 1.3.5 2020-02-11 12:27:56 +01:00
Brian Gough
9a4124ee11 Merge pull request #97 from overleaf/bg-update-node
Update to node:10.19.0 docker image
2020-02-10 10:00:43 +00:00
Brian Gough
98b29889bd Merge pull request #95 from overleaf/bg-revert-unnecessary-changes
Revert debugging PRs for node 10 upgrade
2020-02-10 10:00:17 +00:00
Brian Gough
e0e2090a42 update node version in nvmrc and buildscripts 2020-02-07 14:41:12 +00:00
Brian Gough
04a9d66784 use public node:10.19.0 image 2020-02-07 14:15:48 +00:00
Brian Gough
0d667d7ac9 Merge pull request #96 from overleaf/update-node-10
update to gcr.io/overleaf-ops/node:10.19.0
2020-02-06 03:39:53 +00:00
Brian Gough
abe4d1d525 update to gcr.io/overleaf-ops/node:10.19.0 2020-02-06 03:34:30 +00:00
Brian Gough
64bd739a87 Revert "Merge pull request #91 from overleaf/spd-trycatch-all-the-things"
This reverts commit 2bf7f14f9d050c58f141f465633bb6e274b903dd, reversing
changes made to 989240812532ca43a52513339f4dda8f44a80a64.
2020-02-05 10:05:36 +00:00
Brian Gough
3f9cfba5a2 Merge pull request #94 from overleaf/bg-upgrade-node-to-10.18.1
upgrade to local node:10.18.1 image
2020-02-04 16:25:04 +00:00
Brian Gough
4ec82b1baa upgrade to local node:10.18.1 image 2020-02-04 15:02:15 +00:00
Simon Detheridge
85db0822eb Merge pull request #93 from overleaf/spd-econnreset
Handle ECONNRESET in the same way as EPIPE
2020-02-04 14:04:58 +00:00
Simon Detheridge
4102aa0580 Add more detail to metric 2020-02-04 14:03:56 +00:00
Simon Detheridge
8e45a62e32 Handle ECONNRESET in the same way as EPIPE 2020-02-04 13:58:45 +00:00
Simon Detheridge
7663e9689e Merge pull request #91 from overleaf/spd-trycatch-all-the-things
Add try/catch around all client emissions
2020-02-04 13:21:49 +00:00
Simon Detheridge
3e1cffb8a9 Merge pull request #92 from overleaf/spd-no-fatal-epipe
Don't shut down on uncaught EPIPE
2020-02-04 13:17:54 +00:00
Simon Detheridge
fbff3fe727 Don't shut down on uncaught EPIPE 2020-02-04 12:56:43 +00:00
Simon Detheridge
9fd4699098 Merge remote-tracking branch 'origin/bg-avoid-emit-when-client-not-connected' into spd-trycatch-all-the-things 2020-02-04 12:35:35 +00:00
Simon Detheridge
216a977922 Add try/catch around all client emissions 2020-02-04 12:13:03 +00:00
Brian Gough
ebb83e4633 use diconnected property, not connected 2020-02-04 11:59:25 +00:00
Brian Gough
7380d523d5 avoid emitting when client not connected
the emit is happening asynchronously after the client list is computed,
so clients may have disconnected in the intervening time.
2020-02-04 11:39:37 +00:00
Brian Gough
d12e056f08 Merge pull request #89 from overleaf/bg-improve-shutdown-logging
improve shutdown logging
2020-02-04 11:19:50 +00:00
Brian Gough
e263d37476 pass the signal correctly to the shutdown handler 2020-02-04 11:14:53 +00:00
Brian Gough
1fc8cc44c3 log shutdown messages as warnings 2020-02-04 11:14:14 +00:00