Skip to Content.
Sympa Menu

freetds - Re: Patches

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Stan Liberman <stan AT vailsys.com>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: Patches
  • Date: 27 Jun 2002 10:52:23 -0500


On Wed, 2002-06-26 at 21:07, Brian Bruns wrote:
> 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.

Actually, I've just realized that I forgot one more patch for configure
- in order for these functions for work properly _REENTRANT must be
defined in the DEFS.

>
> > 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.

Ok. For some reason I was under impression that this return value of the
dbsqlok was checked against TDS_ERROR - it looks like I was wrong.

> Otherwise,
> the patch looks ok, was it intended only to deal with tds_process_cancel?

Yes. At least that was the only place we have discovered a consistent
problem.

>
> 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 :)
> >
>
>
> ---
> You are currently subscribed to freetds as: [stan AT vailsys.com]
> To unsubscribe, forward this message to $subst('Email.Unsub')
--
Regards,
Stan





Archive powered by MHonArc 2.6.24.

Top of Page