Opened 6 years ago

Closed 6 years ago

#2127 closed enhancement (fixed)

Replace DNS resolver mutex with group lock

Reported by: nanang Owned by: bennylp
Priority: normal Milestone: release-2.8
Component: pjlib-util Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported: no

Description

Currently the resolver releases the mutex when invoking callback, which may cause crash in these scenarios:

  • destroy from within callback context,
  • destroy while callback is being executed (from any context).

The crash can be avoided by replacing the mutex with group lock (thanks to reference counter functionality provided by the group lock).

Also note that the resolver docs recommends to destroy-recreate the resolver to overcome growing memory problem (see section "Resolver Limitations" in here). With the potential crash scenarios described above, it may not be a simple task for application to destroy the resolver without stopping ioqueue & timer first.

Change History (1)

comment:1 Changed 6 years ago by nanang

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

In 5826:

Close #2127: Replaced DNS resolver mutex with group lock.

Note: See TracTickets for help on using tickets.