New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intermittent crashing #80

Closed
technion opened this Issue Dec 5, 2015 · 1 comment

Comments

Projects
None yet
1 participant
@technion

technion commented Dec 5, 2015

Hi,

In an effort to locate occasional data inconsistencies I've setup this pattern in my code:

    case epgsql:equery(C, "UPDATE sth SET latest = $1", [TO+1]) of
    {ok, 1} ->
        ok;
    X ->
        lager:error("DEBUG FAIL ~p, ~p", [TO+1, X])
    end,

"TO" is always a number, and I'm seeing these sorts of failures intermittently:

5:48:08.830 [error] DEBUG FAIL 10166537, {error,{error,error,<<"22021">>,<<"invalid byte sequence for encoding \"UTF8\": 0x00">>,[]}}

I can't work out of this is a bug or if this is me using the library incorrectly, but what I know is that it's not consistent. My gen_server will restart and run the same function with the same input and end up correctly putting it in a database.

I feel I have to be missing something about encoding, or hitting some sort of bug - when the field in question is an INTEGER and UTF-8 encoding doesn't make sense to being with.
Any assistance on this appreciated.

Edit: I don't know if it's related, but the last Travis CI run shows this error as a fatal on several of the tests:
https://travis-ci.org/epgsql/epgsql/jobs/88429294

Further edit: Could this be concurrency related? I don't seem able to replicate if I pull out a series of spawn/1 calls and run everything consecutively. The problem with intermittent issues of course.. if thinking you found a cause..

@technion

This comment has been minimized.

technion commented Dec 5, 2015

Yes, it is a concurrency issue. Resolved by implementing pgapp, although I've brought in an issue over there.

@technion technion closed this Dec 5, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment