Ticket #354 (closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

PostGIS Defect : cursor name conflict make provider crash

Reported by: bscott Owned by:
Priority: blocker Milestone: 3.4.0
Component: PostGIS Provider Version: 3.2.0
Severity: 1 Keywords:
Cc: External ID:

Description

the CreateCursor? function uses a fixed string + the current date and time for a unique cursor name. I have found many cases where 2 or more cursor are created in the same second, so the provider crashes with the "Cursor already exist" PostGIS message.

Adding a random number at the end of the unique cursor name calculation should resolve this issue.

Change History

  Changed 4 years ago by jbirch

This problem was also addressed in #116 by adding more granularity to the time measure. Did this get reverted when the dependancy on the boost time library was removed, or are you seeing conflicts at the microsecond level? Regardless, the potential for conflict still exists regardless of the time interval used.

What are you planning to use as the random seed? Is there some kind of identifier available that is already unique for each query?

follow-up: ↓ 3   Changed 4 years ago by jbirch

Wow, I really am a dork. Can't believe I managed to use regardless twice in the same sentence.

in reply to: ↑ 2   Changed 4 years ago by bscott

Before the boostdatetime dependency removal we had a millisecond based cursor name, i've changed it for a similar algo having the date + hour + minute + second + clock() where clock is millisecond based. But we still have cursor name conflict. I suggest this date + hour + minute + second + clock() + rand() without any seeds. The only way of having the same cursor name is to start 2 mapguide server and initialise there FIRST connection to PostGIS at the same millisecond.

It's still not 100% safe but it's really safer , dividing the probalitity of a clash by RAND_MAX(32767)

  Changed 3 years ago by bscott

  • status changed from new to closed
  • resolution set to fixed

  Changed 3 years ago by mloskot

  • status changed from closed to reopened
  • resolution fixed deleted

  Changed 3 years ago by mloskot

  • owner mloskot deleted
  • status changed from reopened to new

  Changed 3 years ago by mloskot

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.