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

InvalidMemoryOperationError with MySQL pool under heavy load #117

Closed
Abscissa opened this Issue Oct 26, 2012 · 1 comment

Comments

Projects
None yet
1 participant
@Abscissa

Abscissa commented Oct 26, 2012

Not sure if this is an issue with Vibe.d or mysqln (or DMD/druntime for that matter), so I'm posting it here. I don't know whether or not this might have anything to do with the mysql pool not reopening forcibly-closed connections.

My setup: Win7 64-bit 2-core, DMD 2.060 32-bit, Vibe.d v0.7.8, Vibe.d's branch of mysqln

Test source:

import mysql.db;
import vibe.d;

MysqlDB dbPool;
static this()
{
    dbPool = new MysqlDB("localhost", "testdbuser", "testpass", "testdb");

    auto settings = new HttpServerSettings();
    settings.port = 8181;

    auto router = new UrlRouter();
    router.get("/dbtest", &doDB);

    listenHttp(settings, router);
}

void doDB(HttpServerRequest req, HttpServerResponse res)
{
    auto conn = dbPool.lockConnection();
    res.writeBody("hi");
}

If I do:

ab -r -n 1000 -c 1000 http://127.0.0.1:8181/dbtest

Then I randomly get one of the following results:

[00A80F80:00000000 INF] Running event loop...
core.exception.InvalidMemoryOperationError
core.exception.InvalidMemoryOperationError

Or:

[02240F80:00000000 INF] Running event loop...
[02240F80:00000000 ERR] Unhandled exception in event loop: core.exception.Assert
Error@vibe.core.drivers.libevent2(262): Assertion failure
----------------
0x004F34EC in char[][] core.sys.windows.stacktrace.StackTrace.trace()
0x004F3377 in core.sys.windows.stacktrace.StackTrace core.sys.windows.stacktrace.StackTrace.__ctor()
0x004D5D17 in onAssertError
0x0046C7DA in extern (C) void vibe.core.drivers.libevent2.Libevent2Driver.onDnsResult(int, char, int, int, void*, void*) at C:\DevProj\darticles\..\vibe.d-0.7.8\source\vibe\core\drivers\libevent2.d(263)
0x6842E05C in evdns_set_log_fn
0x00486287 in int vibe.core.core.runEventLoop() at C:\DevProj\darticles\..\vibe.d-0.7.8\source\vibe\core\core.d(58)
0x0048E4CF in _Dmain at C:\DevProj\darticles\..\vibe.d-0.7.8\source\vibe\appmain.d(38)
0x004CFB98 in extern (C) int rt.dmain2.main(int, char**).void runMain()
0x004CFBD2 in extern (C) int rt.dmain2.main(int, char**).void runAll()
0x004CF7F4 in main
0x004F9FC5 in mainCRTStartup
0x7539339A in BaseThreadInitThunk
0x77A69EF2 in RtlInitializeExceptionChain
0x77A69EC5 in RtlInitializeExceptionChain
core.exception.InvalidMemoryOperationError
@Abscissa

This comment has been minimized.

Show comment
Hide comment
@Abscissa

Abscissa Oct 27, 2012

This seems likely a duplicate of #30. If further investigation reveals they're separate, we can reopen.

Abscissa commented Oct 27, 2012

This seems likely a duplicate of #30. If further investigation reveals they're separate, we can reopen.

@Abscissa Abscissa closed this Oct 27, 2012

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