GithubHelp home page GithubHelp logo

Comments (4)

peace-maker avatar peace-maker commented on May 30, 2024

The problem appears to be that the problematic file isn't removed from the mgr.importJobs list on failure.

Here it returns that 0 files were processed when one of the pcaps in the batch fail to parse.

pcapInfo, pcapPackages, err := readPackets(pcapDir, pcapFilename, knownPcapInfo)
if err != nil {
return 0, nil, err
}

The caller only logs the error and continues anyway

processedFiles, createdIndexes, err := mgr.builder.FromPcap(mgr.PcapDir, filenames, existingIndexes)
if err != nil {
log.Printf("importPcapJob(%q) failed: %s", filenames, err)
}

And eventually tries to remove processed files from the job queue, but since processedFiles is 0 this will go on forever.

// remove finished job from queue
mgr.importJobs = mgr.importJobs[processedFiles:]
// start new import job if there are more queued
if len(mgr.importJobs) >= 1 {
idxs, rel := mgr.getIndexesCopy(0)
go mgr.importPcapJob(mgr.importJobs[:], mgr.nextStreamID, idxs, rel)
}

The error handling of the Builder.FromPcap function seems bogous. Are there any errors where it's useful to retry? Otherwise I'd just ignore the failing files and continue instead of return. All the other early returns need to be looked at as well.

from pkappa2.

peace-maker avatar peace-maker commented on May 30, 2024

pkappa2 refuses to start after it received an invalid pcap once as well. So the problematic pcaps need to be ignored during startup as well. I don't know if we want to delete them upon receival, but maybe moving into an "invalid" folder for later analysis might be good?

info, _, err = readPackets(pcapDir, p.Name(), nil)
if err != nil {
return nil, err
}

from pkappa2.

spq avatar spq commented on May 30, 2024

i have used some of your patches but left out some that I don't think are needed to fix this and modified some others to have as small an impact as possible.
could you confirm that this is fixed?

from pkappa2.

peace-maker avatar peace-maker commented on May 30, 2024

It appears to be solved now. Thank you!

from pkappa2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.