Showing posts with label bad. Show all posts
Showing posts with label bad. Show all posts

Friday, 5 June 2020

Worst Idea in Development Ever

I'm casting back a long long way, over 15 years to be imprecise as I can, and talk about the worse idea in software development ever.... To perform a group code review once a week.

But before I can do that I need to talk about the good way to do this, code reviews should be non-intrusive for the majority of team members, they should be able to dip in and out, they should fit it into pieces of their day which are spare or otherwise dead time, and it should be use as a tool to not only review the code but introduce familiarity to other people's work & progress to everyone else.

So what was wrong 15 years ago?  Well, the important point about the good way of reviewing code was to actually be able to see the code.... When this new review process was introduced all those years ago... the code was on a machine, whilst we were all in a meeting room and the programmer stood up and verbally described the code to us.

Yes, verbally describing what took all WEEK to do, neither conveyed to us what was being done not shows us how, we were unable to help debug or sense check the logic, and it gave zero oversight into how the code was built, was it efficient for example (we'll come back to that topic in a moment).

And of course the planned one hour meeting was excruciating to be in... and only one developer got to speak in the first session.

There were 6 staff programmers and we were augmented with 6 contract programmers, the "lead" if you could call her that programmer went first... and her presentation was on the hardware to database connection.

It used a Marathon database, which I've just googled and humorously I can't find any references to that product.  And the "lead" had been using it at her prior role on Java based programming, here in C we were a little perplexed by her approach.

For she presented that from the high-speed buttons and lights on the hardware, which had to flash fast and had to be responsive to touch, she had written a system which took the impulses and inserted the values into a "Buttons" database table.  And then another on a loop which polled "SELECT * FROM LIGHTS;" and pushed the "on" or "off" states of the resulting list (from left to right) to the hardware.

Of course was immediately obvious to all but the lead, the manager and her office buddy, would not fly and the three different members of the team, all infinitely more familiar with the hardware and the C language than this lead, pointed out that it would be slow and unresponsive.   That we were on a single core machine so you couldn't just ignore that the database driver would wonder off and do it's own thing, as well as be constantly interrupted by the processing of our system, and the system itself was to be host to third party software which we could not ourselves fully control, so they might run with a tight loop starving our system and especially starving (what was then) a low priority database driver service.

All in all it sounded a REALLY bad idea.

But, she'd already done the work.  The manager had already signed off on her idea in a series of closed doors conferences with her, and her lone office buddy made it clear he was on side.

It was 3 staffers verses 3 "senior" staffers.

It was fact, this was going to happen.


Which brings us to an obvious fault in this "Code Review" no-one could actually get anything changed, we were really there to be told of the fabulous innovation from behind the green curtain.  We could not divert, advise nor simply appreciate the good, bad or ugly in this system.

So it was revision one (of twelve) was issued and immediately a real piece of content (a game) was played on the system... This game already worked on the old system we were replacing, so its behaviour was well established.  And immediately all the lights started to behave badly, they would he updating visually, we could see, from left to right... rather than all coming on together and going off together.

This was puzzling the micro-controller sending the light signals was a 32bit register, you just set the binary representation, and the micro almost immediately lit or extinguished the bulb... Why was it showing this left to right behaviour?

The three of us whom had descented said "are you going through that lights query as a list and applying it left to right?".... "No" came the reply, but she soon disappeared and came back with version 2.

Which STILL turned the lights on left to right, but subtly so, we could see it and the experienced play tested protested it was, but to the uninitiated it was just about passable.  So it went into test proper.

And they reported the same, but opposite feel to the buttons, that they lagged from right to left, and lag they did.

To her credit the "lead" didn't dismiss them and went to actually play the machine, yes she'd not played it until now... and immediately version 3 was issued.

Again, as with the lights, the lag was still there, the left hand most button was the most laggy, and that would make sense if there was a loop which was working through their being updated from right to left for the buttons and left to right for the lights.

But she insisted that there was no loop.

And we had no oversight on the code, even though we had "reviewed" it.

The next morning we walked into find her already present, version 4 had gone down to test.  The tester had put a different game on, which did a different series of light patterns and reported "It doesn't look right at all" (except he'd not been as polite) spurring the new version.

One of the more vocal of our group went to the manager and said "this going through a database is the madness, no matter what she's actually doing in the code, it can't be fast enough to feel like the old direct to hardware system, we need to remove this layer and just go direct".... but the manager didn't want to upset the "lead" so persisted with the database thing.

Release 5, 6 and 7 went down later that day, then about lunch a machine was hoisted up the fire escape stairs and into the office wheeled all the way and plonked next to the lead, she was to debug this properly.

Release 8, 9 ad 10 went only to this machine next to her and the tester was duly dragged up and into the room to sit, painfully, next to her explaining how it should plan and indeed he insisted the old system be wheeled up and plonked right next to the new borked on.

The two boxes side by side it was immediately obvious the new database driven system was really Really REALLY slow compared to the old one.

"It's the database" voices said.


"It's the loop" others called out.



"There is no loop, and the database is fast!" She persisted.


None of us from the C side bought this, and still could not see the code (code revision control is a topic for another day).

Finally, it was Friday, version 10 had remained for all of Thursday, but Friday came and something had to be done.  The engineer responsible for the board, the actual micro-controller was brought in, and he immediately ran his test routine on the board showing the lagging and we saw it being solid behave correctly and work, despite the lass having decried her board was faulty.

The hardware engineer had a view none of us got, he could see the code, he sat beside her and with us all gathered around he blinked, looked at each of us and then looked at the code, then turned to the "lead" and said "you know you can just sent the unsigned 32 bit integer directly to that register, all in one go?"

She looked at him and asked what he meant.

"Well if you want to turn it all on, send zero"... if you want to turn them all on send 4,294,967,295‬"

She blinked and looked at the code and then back at him, "I don't follow".

The hardware engineer looked at all our eager faces, three of us knew what was coming.


"Well, you don't need to loop through each boolean and bit shift them one at a time into your register sending them one at a time, you can still loop and bit shift them all in if you like, but you can sent the command once, set the lights to the value in the register once".


Three of us left the room, the manager looked dumbfounded and a little thunder struck, her office pal was notably quiet.

Version 11 came out about an hour later and the hardware engineer went to leave, popping his head into the office of the 3 of us on the C side... "Why wasn't this picked up in review?"




* Throughout you've seen me put "lead" in air quotes, this is intentional, the lass was not a lead, not as we'd describe today, she was just the loudest voice in the split office, she was furthest from the manager and had this knack of making you feel like she had ALWAYS been there and always been in charge.

I strongly believed she had been at the company for years when I started.

It wasn't until years later that I discovered she had only been in her role two weeks longer than me, two weeks in which she had moved from direct hardware peek & poke to via database.


* Version 12 : Yes you guessed it, version 12 was to remove the database from the hardware interactions completely, an abstract layer was built holding a representation of the hardware in memory and that representation was twiddled from the database side and it's representation imposed on the hardware by directly poking.

Thursday, 4 June 2020

When the Manager Went Fishing

A long time ago in a work group far away there was a bunch of problems coming up in a code base whilst the manager (who had written the very code we were debugging) was up to his knees in a Scottish stream on a salmon fishing holiday....

So yeah, the code didn't work, it was a statemachine implemented in a bunch of "if" statements a smattering of switch statements and flags which were not properly mutually exclusive... so it was a statemachine in name only really.

This particular piece of code was responsible for paying money out of a machine, and as such came under scrutiny when customers started to notice that it was either paying out more than expected or the players of the machine noticed it was paying far less than expected.  A double whammy.

This problem was looked at first by a chap in the team who didn't really get along with anyone else, and he asserted he had solved the problem... I wasn't his manager, but we accepted his word on the matter and issued a release.  This turned out to be the start of a series of problems, for with the focus on this problem the test department took it upon themselves to actually test this fault to within an inch of it's life, and of course they found the problem persisted.

The wheels then came off this development train.

For the technically senior person in the department didn't get on with the chap who had looked at this problem first, they did not get on at all... not one jot.

And I ended up sitting between these two as both a debugging sounding board but physical altercation deterrent, which it's a great place to stand between coworkers who really just needed to grow up.

The debugging progressed from the mess of code into a rewrite of one function, and this started with a large discussion around a 10 foot white board (I love working on a whiteboard).

We came up with the expected behaviour, worked out the inputs we knew and then how to get that expected output to physically happen, and did so.

It worked, it would have taken that one day.... The test department were happy with their results.

The problem?  All releases had to go through review and the binaries built and packaged by one specific person... The Manager... who was still scaring salmon with a pointed stick.

We had to get on the phone to him, do you know how patchy mobile reception is in the highlands?... No... Well, "VERY" is the best way to put it.  We managed to speak to him twice, but then had to get his permission at every step, "Do the work" it's done, "build the binary" it's built, "package the update" it's compressed, "create the release notary" it's written... 

All these calls back and forth to stitch together what should have been my simply putting the package on a flash stick and handing it to the test department (because they tested everything off of our network to be as real to our operating environment as possible).

It was a nightmare... An utter break down in co-worker communications between the other two chaps, the manager not releasing the reins of control*... The slow turn around of a build and messy nature of the codebase we had to edit... not to mention that the problem was subtle and caused by a miss-understanding between the true behaviour of a physical device compared to the expected virtual representation of it within the system's view.

There, that's what happens when the manager went fishing.





* In the hope of accruing himself come modicum of job security by appearing to be a key man.

Friday, 18 January 2019

C++: The Dilemma of using Exceptions

As a C++ developer I've recently been in the midst of the Exceptions debate.  Exceptions as a feature of the C++ language have long divided the community, naively I've often put this down to their coming to the language from elsewhere (C perhaps) where exceptions were not the norm.

This was a mistake, for in the projects I've previously worked upon the overhead of an exception compared to the ramifications of the error resulting in a crash have often totally outweighed the overhead, making deciding to employ an exception exceptionally easy (*bum bum*).  Exceptions were the norm, still are and should be to you too (according to the C++ Core Guidelines https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Ri-except).

The difficulty, the dilemma if you will, comes not from the feature, but the cost.  If you application domain demands high performance you can not risk using exceptions, the argument carries on therefore whether in not using them to avoid that overhead in performance you are actually cutting off your nose to spite your face... What are the downstream costs if an unexpected, in tested for, error occurs and some strange behavior ensues, or worse it propagates up and out of your application to crash?!!

In the modern era of social media such feedback is near instantaneous, can you afford the egg on face?

And so you spin yourself around and dig further into the ground your problems.

Voices from industry do little to alleviate the problem, google for instance (https://google.github.io/styleguide/cppguide.html#Exceptions), almost seem to advocate using exceptions if from the ground up you can build them in.  You stand the cost of retraining developers and change your ways of working around (e.g. embrace RAII).

They even go so far as to state "the benefits of exceptions outweigh the costs", but then add the caveat "in new projects".  How old or new your project should not define your error handling mechanisms, surely?  Plus from experience I've always found a code base is as old or new as the minds working upon it.  If you have an engineer firmly rooted in C without exceptions they will continue to churn code in that style through your compiler (which will happily work with it), not because it's a better way of working nor because it's a worse way of working, quite often it's continued along simply under the inertia of experience that developer has and they've not time to stop to take stock.

Even given that time, which the project I've just begun working upon has, there's weight behind the past, the old way of working, what worked before, and if that was non-exception handling code people stick with it.  Tell those self same people "you really should use these, oh and you have to retrain your minds, plus it'll take longer to compile and more time to run" they're going to stare at you like you're mental.


The question I'm left with is therefore not whether to use exceptions or not (well I am left with this problem, and this post is no help) instead we're left with the question of when will the benefits of exceptions, their ease of use, simplicity to write and visualise out weight the retraining, compile time and runtime costs?... I don't think that's anytime soon, it should be after so many years, but it's simply not.

x

Thursday, 8 March 2018

Sex, Secret or God... Passwords

In the 1990's it was common to have to tell folks not to use "popular" password, like "sex", or "god", believe it or not even "password" and "secret".  Since then times have moved on, folks have become very adept at using other characters in their passwords...

Unfortunately, this is (very seriously) what one of our IT bods here has just found on a machine:


Props to the user for mixing in some numbers, a word and a symbol, however... We can all see the flaw in their storing the password.


(Thanks to our IT Manager for letting me use his picture - it is a lovely left hand, I wonder if he does hand modelling?)

Tuesday, 6 March 2018

KitKat Still Broken....

No, I'm not talking about any build of Android, I mean the actual chocolate bar...

Having my first one since June last year...  Still broken.

Friday, 5 January 2018

Bad Code...

You know when you open someones code and you find this inside a class function...

unsigned short currentMessageOffset = this->CurrentMessageOffset;

That you're in for a rough ride.

First of all, WHY assign the member value on the right to a local?  No-where else in the class is this value edited or read, so there's no need to assign it to anything.

And then the naming, this naming of something local with the same name, and it is the same name, despite the capitol leading letter, it's the same name, just makes this utterly useless.

All this before even mentioning that the code is an assignment not an allocation, so annoying.

Wednesday, 4 October 2017

Virgin Media's : I'm Sick and Tired of You

I've had my broadband with only two companies in twenty years, NTL and then Virgin whom bought NTL.  I've had them at three addresses and never had cause to really complain, sure for a while I had a junction box which would fill with water whenever it rained, so cutting me off, but they sorted that quickly enough.

However, for the last year I've paid for 200mbit speed, super speed, being who I am I immediately started to monitor the speed, and initially I did get around 198mbit download speeds with a constant 12mbit up.

Unfortunately over the last four months that speed has dropped off and off, so much so that my automated server started to report 4mbit.  I tweeted VM about this, of course I received the standard line that this was my equipment.  I called them about it and was told that "over wifi you get much less download speed than you pay for", except I'm using Cat 6 over a gigabit LAN... "Cat what?" the operator asked, as I was simply no longer on their lookup script of replies.

In the end things came to a head when I also noticed that the TV package I was paying for went from a stately total of £50 a month to just over £80.  That's quite a hike, and I looked realistically at what we watched and found it not to be worth it.

The absolute soul cracker was my week away disconnected in Wales, where we had a freeview connected TV, and there was so much choice, right there, free to air.

We were both also sick of the recycled land-line number constantly rining with whoever only knows looking for past holders of the line for debts or catalogues or PPI, so much so I took up a distinct accent whenever answering my own phone to put people off calling.

So, no TV needed, no Telephone we just need basic broadband.

And the persuit began, I knew the name of the exact product I needed, I needed to go from Vivid200 Broadband to Vivid50 - why pay for something you're not getting - and that was it basically, the rest could go, but I thought I'd challenge them...

Now have you ever watched Morgan Spurlocks "Supersize Me!" and it's effect on the fast-food industry?  Well, this same effect is underway within Virgin Media, they upsell, they upscale, they ask if you want to supersize, and they simply can not ever stop doing it, you say "no", you say "stop" you say "less"... And they do not understand.

You're stuck calling a gaggle of people who are not native English speakers, sometimes to lesser or greater effect, and they do not understand you want less.... Three point manefesto in this conversation was simply... "Drop the telephone line, reduce the broadband speed and I'll listen about the TV for ease".

The lines which came back to me beggared belief... "We can not give you a lower rate on your TV without your having the weekend calls"... "Having the calls makes the package cheaper".

The saving through the package £6, the additional cost in the package of a phone line £10.99... So how was I saving anything?  That's right I wasn't, but on their screen the two HAD to go hand in hand, they could not, were unable to, untrained and not savvie enough to realise I had no need for and some concerns with the recycled number of the line we had, but they just could not figure this out.  Extremely poor customer service ensued.

"Your bill is so high because you had the McGregor fight" yes we did have that ordered, yes... "This proves my point, I'm paying for this TV package and still having to pay more to watch the items I want to watch, so where is the incentive for me to pay for the package?"

Silence.

There was simply no answer to this, the chap then passed me without asking, to a "supervisor", with whom I had to go through this whole rigmorale again.

I'd had 15 minutes of this online, 20 minutes with the first chap, and over a year of issues with the broadband speed and phone line, so I simply snapped... "Cancel it"

"Cancel the TV, Cancel the Telephone, and drop the broadband to VIVID 50 whilst I look for an alternative supplier"

The guy didn't even argue, he just did this, they are so blasé about their customers, we are such sheep, decades of supply are but nothing, they're not interested in you.

Ten minutes later I had started to investigate freeview or freesat to my fancy Sony TV... It has both.

Half an hour later I have over 600 channels on Freesat, with one wire now at the back of my TV, and no additional power usage from their slow TiVo.

The only thing the wife and I are missing is pausing live TV, however, I think the TV will do this with the addition of a USB Harddrive... And I know I have several of them lying around!

In conclusion, fuck you Virgin Media, sick and tired of you.

Thursday, 4 May 2017

Software Engineering : My very bad way to set up makefiles

I may have wrote this post, but I'm just being lazy... Read on.

I've made other Boost videos, and other codeblocks videos, and I've always assumed that the user at the other end was well aware of how to compile & build code.

However, it seems there are lots of users whom are not aware of how you actual create a program from source code, at least not with C++.

So I'm going to show you the absolutely most wrong basic way of creating and using a makefile to perform a build...

The first step of C++ program creation, is that trivial matter of creating the source code, easy right?... Yep, so lets skip that step, and go to when its once  and we want to pass the code through a compiler, the compiler turns the source not into a program, but into an intermediary format called an object file or object code.

The compiler then leaves the process and another program takes over, this second program is known as the Linker, and it takes the object code and links it with all the system calls and other libraries you are wishing to use.

There are other steps involved in the process of building a program, however, compiling & linking are the two main steps; when I began programming you were made very much aware of this by the compiler and linker generally being such large complex programs and the libraries being so big you had to physically change floppy disk between the different steps of the process.

This process was also taught to me in school & later college, it was common practice to understand a compiled program was actually compiled then linked.

Unfortunately, this knowledge seems to have fallen in to the way side, it is of course more important to learn how to program than be bogged down in minutia, however, once you have learned I strongly believe you should expand your knowledge and really have a holistic knowledge of the craft of programming.

So, back to our program, the make file, what might they look like? Well they are simply text files,  which contain commands very similar to bash script... We call this make file script by passing it to the "make" program, you can get make for Linux, mac or alongside MinGW for windows.

Lets start writing a make file for any basic C++ program, which links the Boost libraries we've built somewhere on disk, and which looks like this:


#include <iostream>
#include <string>
#include <boost/filesystem.hpp>


int main (int p_argc, char** p_argv)

{
     if ( p_argc > 1 )
     {
          std::cout << "File or Folder ";
          std::string l_pathString(p_argv[1]);
          boost::filesystem::path l_path(l_pathString);

          if ( boost::filesystem::exists(l_path) )
          {
               std::cout << "Exists!";
          }
          else
          {
               std::cout << "Not Found";
          }
          std::cout << std::endl;
     }
}

Save this as "main.cpp" and then define a variable called "FILES" into which we place this filename.

FILES=main.cpp

We want to start our make file with a variable which contains the compiler we wish to use, for Linux on my test machine I'll use "g++".

CC=g++

So now we have a value called "CC" which is a string of characters with the value "g++".  The dollar sign indicates that "CC" is a variable within the script, which we might want to use later, I use these kind of variables throughout makefiles so I can place at the top any paths or references I like, or I can alter them when I move the makefile from Linux to say Windows, without needing to change hundreds of places throughout the script, I can change just one location.

I find this working with strings is 95% of what working with makefiles is about, next in the file we then define the strings for where to find both the boost headers and the binary libraries are...

BOOST_INC=/home/xelous/boost
BOOST_LIB=$(BOOST_INC)/stage/lib

Notice, I create the root folder for boost as one variable, and then in the next line I use that variable to extend into the "stage/lib" folder, so I never duplicate the root folder for the boost libraries.

We can now define at least our build command, slightly different the command is a verb, in this case "build", which is the command we will use here, but which is also the default.  If you save this makefile as "makefile" in a folder, then navigate your console to that same folder and type "make", the make program will look for "makefile" by default, find it and build the "build" verb by default!

build: 
   $(CC) -I$(BOOST_INC) -L$(BOOST_LIB)

So, what is this command doing?  Well it is saying to use the compiler, with the Include folder for boost and look for libraries in the boost library folder we've set.


The "-I" and "-L" parameters are the same parameters one would use on the command line for "g++".  This command therefore equates to "g++ -I/home/xelous/boost -L/home/xelous/boost/stage/lib", but I think you will agree it is somewhat easier to manage.

We also need to tell the program to link against some libraries, and that we want them linked statically in this case.   So our next variable will be called "CFLAGS1" to pass the Compiler flags to the command.  Back at the top of our make file I therefore add....

CFLAGS1=-fpermissive -Wl,-Bstatic

This file tells the compiler to be permissive of some common errors and treat them as warnings.  You can use whatever parameters you wish for your compile, the flags available and their meaning are quite varied, however you will need to use a second set to within the build command, so lets define that now....

CFLAGS2=-static-libstdc++ -std=c++14

The second tells the compiler and linker to link against the static versions of the libraries we select later, you will need to look at the boost invocation pages in order to go back over our previous posts and build boost static and take advantage of this option.

I'm not going to explain static linking here, nor any of the other switches, available.

Now we're linking the C++ standard library, and boost, statically we need another variable with the list of libraries to link, on the command line to g++ this is with the "-l" (lowercase L), except with we are going to make the program threaded, so we can set up a new makefile script variable called "LIBS", into which we set the libraries, like so.

LIBS=-pthread -lboost_signals -lboost_system -lboost_filesystem

We now have the compiler, the folders, the libraries, the flags... What about the target file for the build?... Well I want it to be an executable called "
fredrick".

TARGET=-o fredrick

Now we need to put this all together into a command, just running the script with the variables does nothing, we need to define a verb... Lets call this "build" a verb in the makefile has to have a colon following it...

build:

And we can tell make what to perform for a build:

build: 
   $(CC) -I$(BOOST_INC) -L$(BOOST_LIB) $(CFLAGS1) $(FILES) $(CFLAGS2) $(LIBS) $(TARGET)

We might also want to clean the project, so we'd want to delete the target file maybe, by adding another verb:

clean:
   rm $(TARGET)

We can then perform the call "make build" or "make clean" in the folder with this makefile and perform our build.

A bit rough and ready, but it works to get you up and running.

Monday, 27 October 2014

British Gas - Poor Systems

I have to just release this, because if I don't vent, I'm going to blow... The payment and billing systems at British Gas must be so archaic it's untrue, they seem to have different systems doing separate different parts of the same job, and these separate different systems don't share information, so they're out of sync or slow or just so fucking annoying.

I've commented to them directly about this several times and they've simply ignored me, but now I figure its beyond a joke.

Last night, I had a reminder to submit my meter readings, so I popped onto their website to put them in, as I logged in I noted last months bill was still not paid, so I checked and made payment in full.  Submitted the new readings and had an instant bill...

Here's my first beef, if my bill was a reading last time and a reading this time then the values are consecutive and they calculate a bill instantly, and I paid it instantly....

However, the previous bill went unpaid for a month because the bill prior to that was estimated, and they waaaaaaay over estimated, so the readings went in and they were lower than even the estimates that had been put in.

The system immediately has a brain fart and doesn't give a bill, so after waiting all weekend for it I clearly gave up and didn't pay all month, because their system is just so shit, I figure a human had to intervene somewhere and reconcile their stupid estimate bullshit and issue the bill, and I can say this happens because more than once I've had to call them and correct a bill, to have to manually intervene and call an Indian call centre just to get a bill is wholly unacceptable in my book, it's the online equivalent of standing up and waving for the waiter in a restaurant and him giving you the finger.

So what did the website do last night?... Well, luckily this time it generated a new bill, and so I paid the first, submitted and paid the second... right done?... All cool...

NO!!!!!!

Because fucking hours later another system at British Gas decides to e-mail me and tell me I need to submit my readings....

Time runs upwards here, earlier messages are lower...

I'm tempted to go give them a reading which is like 1kw/h different and watch their system's brain drop out... Or even, I might start submitting individual readings each time the gas and electricity meter changes value... You know proper spam that sucker, I've read their billing small print there's nothing which says how few readings one has to make, just that one has to submit a reading or allow access to the meters by reading taking staff at intervals...

So, I use say 301Kw/h of electricity per month, lets submit 301 readings, their system asked me to submit a reading 5 hours after I'd done just that for the month!

Thursday, 13 February 2014

Thread Safety - Don't #1

Do not oscillate the value of an integer as the back-bone of making your code thread safe...

IT IS NOT SAFE
IT IS NOT RIGHT
IT IS NOT CLEVER....


int m_Count = 0;


do
{
    if ( m_Count++ == 0)
    {
        DoFunction1();
    }
    else
    {
        DoFunction2();
        m_Count = 0;
    }
}
while ( true );

This is not good code... This is bad... Evil... Malign... Code.

Thursday, 23 January 2014

Network Guru Fails at Monitoring his own Bandwidth

Do I come on here to bemoan the seeming incompetence of others a lot?... Because I have  just had an annoying 20 minutes talking to one of our "Network Experts", there's a server box running Ubuntu, its actually a virtual machine, and it was being blamed for crippling the network on the host machine - which has to run several other Windows Server 2008 Virtual Machines.

For some reason, this came across my desk, because someone has decided that though I can't advise the company on Linux server usage or adoption, I can be called into sort out the problems other fools create.

So, this server was running, the administrator chap is sat there with PuTTY connected to it and he's saying there's too much network traffic coming from the box.

Looking at the process list the machine is doing nothing, when I ask for one of its users to be made to use it, the CPU usage is a time flitter and then the usage is over, it appears to me the Virtual machine host is waking the VM, using it, and closing it.

The processes being used are simple webservices, so there should be no network traffic unless someone is using the server.

So, I ask.. "What's your idea that this machine is causing the issue?"  Very smugly the admin presented me with an A4 sheet with two graphs, one shows all his servers running with the Ubuntu machine present, and there's a whole load of traffic going on... The next is the same graph, with the Ubuntu box removed, and there's nearly no network traffic.

Then within PuTTY connected to the box he opens iptraf...


And he points to the statistics and declares, "See, this is running multiple kilobytes a second"...

Lets recap... "This machine is crippling our network usage on this box".... "using up kilobytes a second"... If any of you don't grasp how absurd this is please stop reading now, because the guy was clearly serious.  He's not that old, he's younger than me, surely he realises kilobytes a second on a modern gigbit backbone is nothing?  No, he seriously wants the ubuntu box silent.

So, what's causing this tiny trickle of bandwidth... Of course, he's connected to this machine with PuTTY...

"Close this window and take me to the machine in the server room"

In we go, and from the console plugged into the machine I run iptraf... look what we see now...


Yes, its zero...

When he is running his measures and checks he's connected over the network to the machine, he's been measuring his own bandwidth administrating the machine, and apparently the kilobytes per second that took were too much for him, I feel like this guy should be thrown from the building, not be earning far more than me in the "superior" position of "network guru god" which hs holds...

So knowing the machine is idle, I wonder what causes the bandwidth, so with the iptraf still running, I call up the user and ask him to get working again... and sure enough there's little trickles of bandwidth from the Ubuntu box, no spikes, no major blocks of transmission.  Hence after a few minutes I conclude the Ubuntu box though active, is only taking a tiny amount of the total bandwidth available to the machine, and so I start to look at the other machines...

And with just perfmon on the two Windows Server 2008 boxes with the user operating his end, I can see that the Windows boxes are spiking their network traffic, just with task manager you can see one box taking 20% the total available to it, and the other over 45%... This is a gigbit connection, and 20% of it is taken for maybe 30-50 seconds each minute and then goes quiet, then the 45% hog is there for maybe every 10 seconds of each minute.

They're scheduled tasks, as the users input items into their programs, the programs process and send out instructions, e-mails and update other databses.  The trickle of data I/O to the ubuntu machine is just such a feed, the Ubuntu box sucks/queries data from MS SQL Server on one of the machines and squirts it into MySQL where a very old (like 8 year old) unmaintained program written in C with MySQLConnector picks it up and uses sendmail to e-mail a load of people.  Such notifications take maybe 0.25 seconds and run every 5 minutes, the amount of data is small, and looking at the physical name of the Ubuntu box "e-mailer relay" I think it's safe to say its not using a lot of bandwidth and the other machines are to blame.

How I educate the "network expert"... This is my next task.

Friday, 10 January 2014

Exceptions, Excepting their Exception... An Adventure into Stack Overflow Hell

If you're going to throw exceptions, and display those exceptions, don't let the code showing exceptions throw exceptions...

This may seem very obvious to those of you out there with a modicum of common sense, it may seem simple and you might be saying... "Xel, why the fuck are you pointing out the obvious to us?"

Because you know this... And you know I know this... Its common sense right... Right?... RIGHT!??!?!!?

No it's not, cus I've just spent half an hour banging my head against the screen, with half a collection of machines working fine, but the other half not operating and throwing spurious errors out of mscorelib...

The error being "File Not Found"... Well, the reason that we got this error was that the system was trying to tell us something, but as it was trying to tell us, the formatting for the fancy exception screen was missing, and so the exception caused an exception... And to add insult to injury the exception from the exception, caused an exception, and eventually this shitty code ended in a Stack Over Flow exception... Which... yes you guessed it, caused an exception... it all just collapsed horribly.

So, people, keep it simple, and keep it stupid!  Because this saves me time, energy & worry!

Saturday, 12 October 2013

Pilot Knocked Out!

What have all these screen shots got in common?




Yeah, they all show my pilot getting knocked out, this seems to be happening a LOT, and not just on rookie crews with no vitality either, this is happening on my highly trained Brits and Japs, this is happening all the time to me.

And I'm even causing it a LOT to enemy players.

In one case I was knocked unconscious by a destroyer, another time by AA, so its happening from AI targets too, it just seems to be the current trend it not to knock the plane down, in fact these upgrades allowing airframes and control surfaces to soak up punishment tonight have meant nothing, because puff... dead pilot... just kept happening over and over and over.

Another buggy problem, my Cromwell has been on the sinking side... I've had it get stuck like this, in the ground more than once tonight, ruining my speed - and getting me killed... No idea why, I got good settings, good connection... but... puff ground sucker..


There's no sign of the Artic Silver thermal compound, so no updates on the PS3 rebuild yet... But... we'll see what the postman brings tomorrow.

The final bit of news is WarThunder are announcing their ground forces tech trees tomorrow.. YUM!

Friday, 27 September 2013

Sky Internet Customer Service Sucks

I've had a very busy few days, I mentioned a certain bank dragging their feet, well all is forgiven they've got into gear and are getting on with things.  However, not before I've been accused by the party on the other side of this transaction - a transaction wholly out of my hands - of being a time wasting bastard.  Hey ho.

I'm also investigating issues with the in-laws ADSL, now I hate ADSL, I hated it when it was ISDN and I hated dial-up even more before that.  I have, since 2000, exclusively used cable internet services, they're faster and for the most part more reliable, for instance cable in my area has been fiber optic since around 1996 when it was laid.  Not like the Johnny Come Lately British Telecom offering of "Fiber has arrived".. yeah, well I've had fiber a long long time slow coach.

The issue with the in-laws connection though is a case of the utter diabolical service from Sky, their provider, Sky's service just piggy backs on BT's infrastructure, and its ADSL based... I hate ADSL... I don't have spare routers for them to try, and I don't have filters or anything like that... so I'm struggling to fix the issue, and the reason is that Sky simply put the burden of proving the fault on the customer.  Its not a case of calling customer services and getting actual customer service.

No, its a case of calling Sky customer services and being told to fiddle with wires, filter and even wall sockets like some giant rubix cube and their telling you how expensive it is to involve BT Open Reach into this situation...

Now, luckily Sky customer services were not telling these tales of woe and foreboding to the technofeeble in-laws, they were telling me, and I batted them out the ball park as the bull shit they are.  Though Sky insist the issue is not their end, its with "your" router.

The router which is sat in their home says "Property of British Sky Broadcasting"... yet sky say it "belongs to you" and "you have to buy a new router"... yet the label on the router says "property of sky, do not dispose, not for resale"... its like... erm.. this is your kit, I'm just a customer paying for a service.

I'm tempted to lay the whole statutory rights on Sky here, because in essence the in-laws have been without a service they pay for, for over a fortnight, and all because Sky are arguing, or trying to rope the in-laws into being stuck with them for a further 12 months contract on the internet...

Anyway, I have an ADSL router to try, and I'm going to strongly advise the in-laws to move to a cable internet provider in the area.  Sky suck, their customer service is the worst I've come across - whilst actually sounding legit - they are so full of shit its untrue, they may as well just let this guy do their support... 

http://www.youtube.com/watch?v=byFhCC2pUEU


UPDATE 30/9/2013 - I finally got them to admit a line fault, I did this by borrowing $1000 worth of Cisco professional grade routing kit from work and setting it all up and running my own reverse line test, when the guy (who, give him his due was helpful) on the phone then tried to argue I had them by the short and curlies because I could see them just try to PING the line... Some line test... and I could see the carrier wave of the ADSL coming and going with no more than a 12% peak it was unacceptably low.  Explaining all this worked (well i think pointing out I had Cisco testing kit attached worked) and now an engineer appointment is booked.

But, not before four very technical phone conversations, not before proving absolutely everything in the house was in order and having to borrow professional kit to prove the point, an unacceptably high level of entry just to get a support call booked me thinks.

So I stand by my statement, Sky customer service, your bar to entry is too high, so you suck!  Support shout be "Have you turned it off and on again?"... "yes".... "Right, we'll come see", even it there is then say a £10 call out charge or whatever.

But to blanket say "no" and then only offer to send out a new router IF they sign up to 12 months more contract.  If it were me, I'd tell you to get stuffed after already having been a customer for 10 years.  I don't need to sign up for 12 more months to prove loyal and worthy of support, I already pay my monthy service fee to be worthy of help!