Skip to content

busy loop cpu 100% #546

@wangxuanyue

Description

@wangxuanyue

run ./usql_static

Image

ENV : Linux 5.10.0-46.32.uelc20.x86_64

The problem reason given by AI:
This is a known issue, typically occurring in specific environments (especially during static builds), causing the readline library to stop blocking while waiting for input and instead continuously return empty results, which leads the main loop into a busy loop that consumes 100% CPU.

<<<<
        case cmd != "":
            opt, cont, lastErr = h.apply(stdout, stderr, strings.TrimPrefix(cmd, `\`), paramstr)
        }
====
        case cmd != "":
            opt, cont, lastErr = h.apply(stdout, stderr, strings.TrimPrefix(cmd, `\`), paramstr)
        default:
            if iactive {
                time.Sleep(time.Millisecond)
            }
        }
>>>>

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