-
Notifications
You must be signed in to change notification settings - Fork 61
Conversation
packages/functional-tests/src/app.ts
Outdated
@@ -116,44 +116,42 @@ export default class App { | |||
private async displayFunctionalTestChoices(rootActor: MRESDK.ActorLike): Promise<string> { | |||
return new Promise<string>((resolve) => { | |||
let y = 0; | |||
for (const key in this.testFactories) { | |||
if (this.testFactories.hasOwnProperty(key)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.testFactories.hasOwnProperty(key) [](start = 20, length = 38)
I thought this was required, TS-lint complaining if missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's required with for..in, but not for..of.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this._conn.off('error', this.disconnect); | ||
this._conn.close(); | ||
this.emit('close'); | ||
} catch { } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
catch { } [](start = 10, length = 9)
should you log error here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm intentionally not logging errors here because we're in the process of tearing down the session. Various errors can happen depending on how "started up" the session was in the first place. I just want to make sure exceptions don't interrupt the shutdown process from completing.
In reply to: 252832190 [](ancestors = 252832190)
513dfb9
to
0fc7bc4
Compare
This changeset started out as an update to the user join process to add protections against zombie sessions. Along the way I encountered and fixed a few other issues (list below).
Glossary
Zombie session: A session where the authoritative peer has become unresponsive but not disconnected.
Zombie session mitigations:
Handshake new connections before adding to session: When a new WebSocket connection is made we no longer spawn an app session right away. We now run through the handshake process first. Once handshake completes we pass the connection to a session where join-in-progress is initiated. This should filter out the unresponsive new connections reported by @willneedit.
Kick unresponsive peers: Messages sent to the client that expect replies now have timeouts on them. Default value is 30 seconds. This can be disabled by setting ConnectionTimeoutSeconds to zero (helpful when sitting on a breakpoint). When a message timeout triggers, the connection is forcibly closed.
Fixes #104
Other changes:
assets-loaded
messages to the app if sent from the authoritative peer.position
androtation
fromRigidBody
class.