Skip to Content.
Sympa Menu

freetds - Re: Cancel problem

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Brian Bruns" <camber AT ais.org>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: Re: Cancel problem
  • Date: Wed, 4 Sep 2002 11:45:15 -0400


Ok, I was erroring on the side of safety. But if we can in fact optimize
this by discarding whole packets then maybe we should. We could do like:

tds_read_packet() until header flag is 0x0f, then do normal processing
until done w/ cancel flag. It could still be all done inside
tds_process_cancel(), I think this is post 0.60 work. The patch as is
should be fairly non-distruptive.

> >
> > The current code will handle a TDS_DONE with cancel message
> > anywhere in
> > the stream. tds_process_cancel will read the stream until it
> > sees it, it
> > doesn't ditch whole packets, but reads the PDU's. TDS_DONE
> > w/ cancel flag
> > is guarenteed to be the last PDU of that stream received.
> >
>
> Good!
> So even this problem is solved.
> I think we should add a test for this stuff.

Good idea, problem is that the tests will vary with network speed and
server load. Only repeatable test would be on an idle connection, or
perhaps using a cursor?

>
> > What happens currently, is this: The cancel is sent and the stream is
> > read until we get a done w/ cancel. Nice and simple. The
> > tds_read_packet
> > semantics were broken because we couldn't tell the difference
> > between a
> > error and zero length payload. With the cancelling state we
> > have problems
> > with streams like:
> >
> > --packet 1
> > result set 1
> > row
> > row
> > row
> > --cancel sent
> > -- packet 2
> > row
> > row
> > done (no cancel)
> > result set 2
> > row
> > row
> > --packet 3
> > row
> > done (with cancel)
> >
>
> This should be impossible
> Server should return
> --packet 3
> only-header cancel acknowledge
> --packet 4
> done (with cancel)
>
> > The cancel code needs to understand the stream in order to
> > skip the rows.
> >
> > So skipping full packets is not an option afaict.
> >
> Skipping packet is what documentation say...
> However... it work!
>
> freddy77
>




Archive powered by MHonArc 2.6.24.

Top of Page