Skip to main content
GilSteidle
Participating Frequently
Jan 29, 2024 12:39 PM UTC

Intermittent UniVerse Write Failures

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

    6 replies

    Neil Morris
    Rocketeer
    Jan 30, 2024 6:34 AM UTC

    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
    ------------------------------
    Tyrel Marak
    Participating Frequently
    Jan 30, 2024 7:32 AM UTC

    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
    ------------------------------
    Andrew Warhurst
    New Participant
    Jan 30, 2024 4:46 PM UTC

    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
    ------------------------------
    Brian Leach
    Participating Frequently
    Jan 31, 2024 9:07 AM UTC

    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
    ------------------------------
    John Jenkins
    Participating Frequently
    Feb 9, 2024 7:57 AM UTC

    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
    ------------------------------
    JJ
    GilSteidle
    Participating Frequently
    Feb 9, 2024 12:00 PM UTC

    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.