Giter Club home page Giter Club logo

Comments (13)

JamesMc86 avatar JamesMc86 commented on July 29, 2024 1

I'm not going to be clever - will change our packetisation to 1024 bytes and be done with it. I guess the solution on the C# side would be a slight delay from reading the size to the full stream to ensure all the packets have landed but reducing our write size just guarantees future success with the same behaviour.

Hooray for integration testing managing to dig this up again!

from g-cli.

joerghampel avatar joerghampel commented on July 29, 2024

Comment from James:

The size out of range error is that we have tried to read the wrong number of bytes from the network stream. This could be: a) LabVIEW sends a zero or negative size or b) LabVIEW sends a size that is too large or c) We have had an unclean read previously which means we read the wrong data.

With the other problems as well I am slightly inclined towards c) (a) should be impossible and the code to handle b) seems robust). Do you know if you could ever write an empty output string? I’m looking at the code and thinking that could cause a problem. Alternatively do you commonly write strings of 8992 bytes or larger?

from g-cli.

joerghampel avatar joerghampel commented on July 29, 2024

I think I’m writing too much data in one chunk - 17000 characters in this case. I go through all VI Analyzer test results and print out any VI that failed, together with the name of the test that failed. Depending on how many VIs fail, this string can become fairly long. I’ll move the CLI write function into the loop iterating through the results, that should fix the problem at hand.

from g-cli.

joerghampel avatar joerghampel commented on July 29, 2024

Comment from James:

That’s interesting. Please try the new version before making your change because it should give more information on the fault. I believed that case should be correctly handled (if you look in the write function in LabVIEW I automatically break it out to 8992 chunks which is the max size the CLI app can use at once)

from g-cli.

joerghampel avatar joerghampel commented on July 29, 2024

So the new version 1.5.1 does give a better message for this error:

C:\Multi-Runner\builds\df1e0484\0\hampel-soft\cmdRead Error
: Bad Length Read: 1548580204
Since the network stream will be out of sync the application will now exit.
LabVIEW/App exiting...
LabVIEW exited with code 0
process tracking thread finished
ERROR: Job failed: exit status 1

I'm still at a loss as to why the error occurs in the first place?

from g-cli.

JamesMc86 avatar JamesMc86 commented on July 29, 2024

Can you save the output you are trying to write to a file so I can test it and see if there is something specific to the output (email privately if you prefer?) I can generate 17000 random characters without issue and it all works.

from g-cli.

joerghampel avatar joerghampel commented on July 29, 2024

Email is on its way. Its size is 18.682 Bytes.

from g-cli.

JamesMc86 avatar JamesMc86 commented on July 29, 2024

Do you remember if this was as an exe or VI? Just seen a similar error when running code as EXE which works fine as VI

from g-cli.

JamesMc86 avatar JamesMc86 commented on July 29, 2024

Scratch that, it isn't so simple.

I've written some integration tests as a batch file (since we need some test coverage to avoid bugs if we change how we launch LV). This was showing the same failure on a large output from an EXE. However the error is sporadic. Whats the money that as soon as I try to debug it then it works!

from g-cli.

joerghampel avatar joerghampel commented on July 29, 2024

I saw that error when running the VIs in the development environment (triggered automatically on my build server). As you already know, I also couldn't reproduce the behaviour...

from g-cli.

JamesMc86 avatar JamesMc86 commented on July 29, 2024

Well, of course now I have a packet sniffer it won't crash again! Will have it automatically try for the afternoon to see if I can catch it in the act.

from g-cli.

JamesMc86 avatar JamesMc86 commented on July 29, 2024

So, here is what I have found from a packet capture. The issue is in the middle of the block from a single TCP write in LabVIEW.

Each write can contain 9000 characters. The idea being this is a multiple of a standard 1500 byte MTU (I now see that to be flawed).

When this is written the driver splits this to several 1460 byte (1500 - header?) packets. What has happened in my case is that only the first few packets are read and then it attempts to read one of these packets as a new header which is where it gets the rediculous read.

I guess the TCP read in C# is not waiting for all of the packets. The simple solution will be to split down the packet sizes in LabVIEW to below 1460 bytes. I will investigate if this is a C# issue though so we don't break it again in the future

from g-cli.

joerghampel avatar joerghampel commented on July 29, 2024

Hell to the yeah ;-)

from g-cli.

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.