Skip to content

aio write imcompletely bug #196

Description

@qinzuoyan

core dump:

F10:16:40.459 (1480990600459595051 156a) replica.io-thrd.05482: assertion expression: size >= this_size
F10:16:40.459 (1480990600459612035 156a) replica.io-thrd.05482: written buffer size does not equal to input buffer's size: 5256 vs 11448

source code:

aio_task* disk_file::on_write_completed(aio_task* wk, void* ctx, error_code err, size_t size)
{
    auto ret = _write_queue.on_work_completed(wk, ctx);
    
    while (wk)
    {
        aio_task* next = (aio_task*)wk->next;
        wk->next = nullptr;

        if (err == ERR_OK)
        {
            size_t this_size = (size_t)wk->aio()->buffer_size;
            dassert(size >= this_size, 
                "written buffer size does not equal to input buffer's size: %d vs %d",
                (int)size,
                (int)this_size
                );

            wk->enqueue(err, this_size);
            size -= this_size;
        }

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions