cwi-dis / vr2gather-orchestrator-v2

Typescript-based version of the VR2Gather orchestrator
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Sessions are not always cleaned up #4

Closed jackjansen closed 8 months ago

jackjansen commented 8 months ago

Sometimes it seems that sessions that have terminated aren't cleaned up.

So when the orchestrator sends a list of sessions to VR2Gather these defunct sessions are included. Here is an example dump.js output, with sessions from someone apparently called Malte

jack@sap:vr2gather-orchestrator-v2% node scripts/dump.js 192.16.197.145:8090
{
  id: 'f43e5bb7-e951-42e2-a15c-96197c0f45b5',
  sessions: [
    {
      sessionId: '300b4a0c-a363-40fd-93c2-b3d38dad0469',
      sessionName: 'Malte_013713',
      sessionDescription: '',
      sessionAdministrator: '5352a34e-d1ee-484e-af76-4ca70b5d8894',
      sessionMaster: '5352a34e-d1ee-484e-af76-4ca70b5d8894',
      scenarioId: 'E7F0D51D-9CC2-401F-B52D-C15AAEC64010',
      sessionUsers: [ '5352a34e-d1ee-484e-af76-4ca70b5d8894' ],
      sessionProtocol: 'socketio'
    },
    {
      sessionId: 'fcdb65d0-7673-4704-b7da-412df6372fe1',
      sessionName: 'Malte_013713',
      sessionDescription: '',
      sessionAdministrator: '5352a34e-d1ee-484e-af76-4ca70b5d8894',
      sessionMaster: '5352a34e-d1ee-484e-af76-4ca70b5d8894',
      scenarioId: 'E7F0D51D-9CC2-401F-B52D-C15AAEC64010',
      sessionUsers: [ '5352a34e-d1ee-484e-af76-4ca70b5d8894' ],
      sessionProtocol: 'socketio'
    },
    {
      sessionId: '4e300769-d445-47b5-8e29-e521e15a9a6f',
      sessionName: 'Malte_013713',
      sessionDescription: '',
      sessionAdministrator: '5352a34e-d1ee-484e-af76-4ca70b5d8894',
      sessionMaster: '5352a34e-d1ee-484e-af76-4ca70b5d8894',
      scenarioId: '8aef4fbe-e8a9-4e70-b009-0633e50cf356',
      sessionUsers: [ '5352a34e-d1ee-484e-af76-4ca70b5d8894' ],
      sessionProtocol: 'socketio'
    },
    {
      sessionId: '00f6b17a-6b26-423d-a356-794b3fa7df19',
      sessionName: 'Malte_013713',
      sessionDescription: '',
      sessionAdministrator: '5352a34e-d1ee-484e-af76-4ca70b5d8894',
      sessionMaster: '5352a34e-d1ee-484e-af76-4ca70b5d8894',
      scenarioId: 'E7F0D51D-9CC2-401F-B52D-C15AAEC64010',
      sessionUsers: [ '5352a34e-d1ee-484e-af76-4ca70b5d8894' ],
      sessionProtocol: 'socketio'
    },
    {
      sessionId: 'e9c7eb32-e072-4cab-8e36-13f7319644fc',
      sessionName: 'Malte_031116',
      sessionDescription: '',
      sessionAdministrator: 'fc1a7704-a0af-458c-b23e-3021a9d1c5f2',
      sessionMaster: 'fc1a7704-a0af-458c-b23e-3021a9d1c5f2',
      scenarioId: 'E7F0D51D-9CC2-401F-B52D-C15AAEC64010',
      sessionUsers: [ 'fc1a7704-a0af-458c-b23e-3021a9d1c5f2' ],
      sessionProtocol: 'socketio'
    },
    {
      sessionId: '2eceb237-7746-4a2e-a1ce-cda55909c20f',
      sessionName: 'Malte_031116',
      sessionDescription: '',
      sessionAdministrator: 'fc1a7704-a0af-458c-b23e-3021a9d1c5f2',
      sessionMaster: 'fc1a7704-a0af-458c-b23e-3021a9d1c5f2',
      scenarioId: 'E7F0D51D-9CC2-401F-B52D-C15AAEC64010',
      sessionUsers: [ 'fc1a7704-a0af-458c-b23e-3021a9d1c5f2' ],
      sessionProtocol: 'socketio'
    }
  ],
  users: [
    {
      userId: 'c0377c7d-4844-4015-aade-6b1ebe01226a',
      userName: 'beelzebub',
      userData: {},
      sfuData: {}
    },
    {
      userId: 'fb3ae644-99fc-4d1f-9ce7-062e23fb5417',
      userName: 'sap',
      userData: {
        userPCurl: 'tcp://sap.local:9901',
        userAudioUrl: 'tcp://sap.local:9900',
        webcamName: 'None',
        microphoneName: 'Unknown USB Audio Device',
        userRepresentationType: 1
      },
      sfuData: {}
    }
  ]
}
jack@sap:vr2gather-orchestrator-v2%

The problem is worse, because when the orchestrator serialises these sessions the result is incorrect JSON, because the sessionUsers contains entries for users that no longer exist. This is probably the root issues behind #1. Here is a sample of the JSON received by VR2Gather for a defunct session:

{"sessionId":"e9c7eb32-e072-4cab-8e36-13f7319644fc","sessionName":"Malte_031116","sessionDescription":"","sessionAdministrator":"fc1a7704-a0af-458c-b23e-3021a9d1c5f2","sessionMaster":"fc1a7704-a0af-458c-b23e-3021a9d1c5f2","scenarioId":"E7F0D51D-9CC2-401F-B52D-C15AAEC64010","sessionUsers":["fc1a7704-a0af-458c-b23e-3021a9d1c5f2"],"sessionUserDefinitions":[{"userId":"fc1a7704-a0af-458c-b23e-3021a9d1c5f2","userName":"Malte","userData":"sfuData":}],"sessionProtocol":"socketio"}

The userData and sfuData have nothing after the :.