Skip to Content.
Sympa Menu

freetds - Re: Patches

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Brian Bruns <camber AT ais.org>
  • To: TDS Development Group <freetds AT franklin.metalab.unc.edu>
  • Subject: Re: Patches
  • Date: Wed, 26 Jun 2002 22:07:09 -0400 (EDT)


On 26 Jun 2002, Stan Liberman wrote:

>
> 574400 - Several patches for thread safety in tds. Our apps consistently
> core dumped at attempt to login from several threads. Pretty much just
> replaced non thread-safe functions with their safe equivalents.

This gets into a sticky situation, older unices will not have the _r
versions of the calls, so we should be checking via autoconf for their
existence and using only then. So, something like

#if HAVE_LOCALTIME_R
tm = localtime_r(&t, &res);
#else
tm = localtime(&t);
#endif

and in configure.in adding:

AC_CHECK_FUNCS(localtime_r)

Otherwise, I'm all for this one going in.

> 574402 - If connection was dropped ( we created it by simply killing the
> database, and once disconnected the network cable ) the application
> using dblib was going into tight loop consuming 99% of CPU.
> There are two fixes: one for tds/token.c checking of the marker is 0 in
> tds_process_cancel, other one for dblib/dblib.c dbsqlok() to make sure
> that tds_process_default_tokens() returns success.
> I'm not sure if this is the proper way of fixing this particular
> problem, but we've been running with this patch for several weeks now
> without any problems.

Looks like you are returning TDS_ERROR from the dblib routines? This is
not a valid return, we should be using SUCCEED or FAIL always. Otherwise,
the patch looks ok, was it intended only to deal with tds_process_cancel?

It's definitely better what we have now, but I'm wondering how
comprehensive it is?
>
> I hope these patches will make it into release, or I'll have to create
> our own branch again (which is no fun). Just a note :)
>





Archive powered by MHonArc 2.6.24.

Top of Page