Opened 5 years ago

Closed 5 years ago

#2243 closed defect (fixed)

Transport reuse stops working after a transport error

Reported by: nanang Owned by: nanang
Priority: normal Milestone: release-2.10
Component: pjsip Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported: no

Description

Original report

Multiple requests should reuse the same connection if one already exists to the remote server. When a transport error occurs, the next request should establish a new connection and any following requests should use that same one. With r6002 patch, when a transport error occurs, every new request creates a new connection so you can wind up with thousands of open TCP sockets, possibly exhausting file handles, and increasing memory usage.
Reverting commit r6002 (and r6021) restores the expected behavior.

After investigation, the pjsip_tpmgr_acquire_transport2() actually tries to lookup any matching transport to be reused, but unfortunately the search does not check if the matching transport is in shutdown state. And later, when it realizes that the transport is in shutdown state, it simply drops the transport and create a new one.

Thanks to George Joseph for the report.

Change History (1)

comment:1 Changed 5 years ago by nanang

  • Owner set to nanang
  • Resolution set to fixed
  • Status changed from new to closed

In 6090:

Fixed #2243:

  • pjsip_tpmgr_acquire_transport2() should skip transports being shutdown in the lookup iteration.
  • Added some tracing logs in sip_transport.c.
Note: See TracTickets for help on using tickets.