Skip to main content

We are seeing UniVerse (v11.3.1) write failures (on Windows 2019 64-bit server) when we repeatedly update a record. Here's the code we use to create this scenario:

OPEN '', 'CF' TO FILE.CF ELSE STOP

ID = 'TEST'

FOR I = 1 TO 1000

READ REC FROM FILE.CF, ID ELSE REC = ''

REC<-1> = I:' Iteration' 

WRITE REC ON FILE.CF, ID

NEXT I

END

The write failures will occur at random passes through the for/next loop.

This particular file is type 19, but we also see failures on hashed files as well.

Is there a UniVerse or Windows tunable setting that would help us out? Any other thoughts?



------------------------------
Gil Steidle
DEV
DDI System Inc
brick NJ US
------------------------------

We are seeing UniVerse (v11.3.1) write failures (on Windows 2019 64-bit server) when we repeatedly update a record. Here's the code we use to create this scenario:

OPEN '', 'CF' TO FILE.CF ELSE STOP

ID = 'TEST'

FOR I = 1 TO 1000

READ REC FROM FILE.CF, ID ELSE REC = ''

REC<-1> = I:' Iteration' 

WRITE REC ON FILE.CF, ID

NEXT I

END

The write failures will occur at random passes through the for/next loop.

This particular file is type 19, but we also see failures on hashed files as well.

Is there a UniVerse or Windows tunable setting that would help us out? Any other thoughts?



------------------------------
Gil Steidle
DEV
DDI System Inc
brick NJ US
------------------------------

What is the error message received? Is it the generic "WRITE failure" message or does it include any additional detail?

If you add a NAP statement into the loop does the problem still happen? Would determine if a timing/concurrency related behavior.



------------------------------
Neil Morris
Universe Advanced Technical Support
Rocket Software
------------------------------

We are seeing UniVerse (v11.3.1) write failures (on Windows 2019 64-bit server) when we repeatedly update a record. Here's the code we use to create this scenario:

OPEN '', 'CF' TO FILE.CF ELSE STOP

ID = 'TEST'

FOR I = 1 TO 1000

READ REC FROM FILE.CF, ID ELSE REC = ''

REC<-1> = I:' Iteration' 

WRITE REC ON FILE.CF, ID

NEXT I

END

The write failures will occur at random passes through the for/next loop.

This particular file is type 19, but we also see failures on hashed files as well.

Is there a UniVerse or Windows tunable setting that would help us out? Any other thoughts?



------------------------------
Gil Steidle
DEV
DDI System Inc
brick NJ US
------------------------------

Have you tried adding an ON ERROR clause with a STATUS()?



------------------------------
Tyrel Marak
Technical Support Manager
Aptron Corporation
Florham Park NJ US
------------------------------

We are seeing UniVerse (v11.3.1) write failures (on Windows 2019 64-bit server) when we repeatedly update a record. Here's the code we use to create this scenario:

OPEN '', 'CF' TO FILE.CF ELSE STOP

ID = 'TEST'

FOR I = 1 TO 1000

READ REC FROM FILE.CF, ID ELSE REC = ''

REC<-1> = I:' Iteration' 

WRITE REC ON FILE.CF, ID

NEXT I

END

The write failures will occur at random passes through the for/next loop.

This particular file is type 19, but we also see failures on hashed files as well.

Is there a UniVerse or Windows tunable setting that would help us out? Any other thoughts?



------------------------------
Gil Steidle
DEV
DDI System Inc
brick NJ US
------------------------------

Try locking the record before writing it.



------------------------------
Andrew Warhurst
Senior Manager, Architecture
Ultradata Australia Pty Ltd
Malvern East VIC AU
------------------------------

We are seeing UniVerse (v11.3.1) write failures (on Windows 2019 64-bit server) when we repeatedly update a record. Here's the code we use to create this scenario:

OPEN '', 'CF' TO FILE.CF ELSE STOP

ID = 'TEST'

FOR I = 1 TO 1000

READ REC FROM FILE.CF, ID ELSE REC = ''

REC<-1> = I:' Iteration' 

WRITE REC ON FILE.CF, ID

NEXT I

END

The write failures will occur at random passes through the for/next loop.

This particular file is type 19, but we also see failures on hashed files as well.

Is there a UniVerse or Windows tunable setting that would help us out? Any other thoughts?



------------------------------
Gil Steidle
DEV
DDI System Inc
brick NJ US
------------------------------

What happens if you wrap the Write in a loop with an On Error and Nap, will it eventually write that entry?

i.e. something like

Done = @False

Loop

    Write REC On FILE.CF, ID  On Error

         Done = @False

         Nap 100

     End Then

          Done = @True

    End

Until Done Do

Repeat

Generally, what you describe is the sort of behaviour if something external to UniVerse is accessing the file periodically - such as an AntiVirus routine that is scanning the file when it is written and preventing UniVerse from updating it whilst it is holding it. I think you said before that you are on Windows, so maybe trace using the SysInternals Process Monitor to watch what is going on.



------------------------------
Brian Leach
Director
Brian Leach Consulting
Chipping Norton GB
------------------------------

What happens if you wrap the Write in a loop with an On Error and Nap, will it eventually write that entry?

i.e. something like

Done = @False

Loop

    Write REC On FILE.CF, ID  On Error

         Done = @False

         Nap 100

     End Then

          Done = @True

    End

Until Done Do

Repeat

Generally, what you describe is the sort of behaviour if something external to UniVerse is accessing the file periodically - such as an AntiVirus routine that is scanning the file when it is written and preventing UniVerse from updating it whilst it is holding it. I think you said before that you are on Windows, so maybe trace using the SysInternals Process Monitor to watch what is going on.



------------------------------
Brian Leach
Director
Brian Leach Consulting
Chipping Norton GB
------------------------------

Brian,

I concur regarding an AV scan as the most likely candidate. noting that if you are synchrionising with a backup or mirror (e.g. cloud backup) then youc an hot the same issue. 

Regards

JJ



------------------------------
John Jenkins
Thame, Oxfordshire
------------------------------

Brian,

I concur regarding an AV scan as the most likely candidate. noting that if you are synchrionising with a backup or mirror (e.g. cloud backup) then youc an hot the same issue. 

Regards

JJ



------------------------------
John Jenkins
Thame, Oxfordshire
------------------------------
We have placed a delay in the On Error clause. This seems to have overcome
the program stopping with a fatal error. Thanks for everyone's ideas,
appreciate them.