#1303 BOSH: Timers stopped on module reload

Reporter shadow
Owner Nobody
Created
Updated
Stars ★ (1)
Tags
  • Type-Defect
  • Priority-Medium
  • Milestone-0.11
  • Status-New
  1. shadow on

    What steps will reproduce the problem? 1. Login with a client that uses a bosh session 2. Killing the bosh client and reload mod_bosh / mod_http almost the same time 3. Re-login with a client 4. See two connected resources. One of them will never vanish What is the expected output? The user should be disconnected properly? What do you see instead? The user will be shown as always online with a dead resource. That leads to a state where people send messages to "online" users and messages get lost. What version of the product are you using? On what operating system? Prosody 0.11.1 - Debian Stable Please provide any additional information below. Since https://hg.prosody.im/trunk/rev/118858bf47cd the used timer method changed. That leads to the fact, that bosh sessions are not terminated correct, if there is a mod_bosh or mod_http reload: You can see it in the following output: Get the resource of the user: ``` # See connected ressource > for res in pairs(prosody.bare_sessions["baduser@jabber.systemli.org"].sessions) do print(res) end | HpzlLFJN | Cod84kAv | Result: nil # Check time for connected ressources: prosody.full_sessions["baduser@jabber.systemli.org/HpzlLFJN"].conn.currenttime | Result: 1547149067.3378 !do date("%F %T", 1547149067) 2019-01-10 19:37:47 # Check full connection details of user > for k,v in pairs(prosody.full_sessions["baduser@jabber.org/HpzlLFJN"]) do print(k,v) end | close function(mod_bosh.lua:222) | thread table: 0x556453cc2140 | roster table: 0x55644850ec70 | bosh_wait_timer table: 0x556450e37580 | bosh_wait 60 | bosh_processing false | dispatch_stanza function(stanza_router.lua:53) | streamid 304bf8e8-b690-406c-8442-4960053ecea6 | sid 304bf8e8-b690-406c-8442-4960053ecea6 | directed table: 0x55644ccd7ef0 | host jabber.org | presence <presence from='baduser@jabber.org/HpzlLFJN'><show>away</show><c node='http://pidgin.im/' hash='sha-1' ext='voice-v1 camera-v1 video-v1' xmlns='http://jabber.org/protocol/caps' ver='AcN1/PEN8nq7AHD+9jpxMV4U6YM='/><delay from='jabber.org' xmlns='urn:xmpp:delay' stamp='2019-01-10T19:30:43Z'/><x xmlns='vcard-temp:x:update'><photo>b6fba0087d7c3f5a90235f5dfeaccd40cc4276d5</photo></x></presence> | bosh_version 1.6 | bosh_responses table: 0x55644b359c40 | filters table: 0x556453cc21c0 | interested_blocklist true | throttle table: 0x556451557350 | ip 192.168.122.13 | conn table: 0x55645489d670 | username baduser | filter function(filters.lua:21) | priority 0 | type c2s | secure true | rid 1.905015600229e+15 | send function(mod_bosh.lua:319) | interested true | full_jid baduser@jabber.org/HpzlLFJN | resource HpzlLFJN | bosh_max_inactive 60 | log function(logger.lua:27) | send_buffer table: 0x5564487b48d0 | requests table: 0x556459c98700 | reset_stream function(mod_bosh.lua:219) | Result: nil ``` The bosh connection is dead and should be killed. Unless it lives forever.

  2. Zash on

    Thanks. Problem is that mod_bosh uses wrapped timers via module api, which are automatically invalidated when a module is unloaded.

    Changes
    • title Users are shown as permanent online, when bosh session is not terminated correctly BOSH: Timers stopped on module reload
    • tags Priority-High Security Priority-Medium Milestone-0.11
  3. Zash on

    Changes
    • tags Hidden

New comment

Not published. Used for spam prevention and optional update notifications.