If trying to establish a session and an error occurs, pyghmi
was not decrementing the usage count on the pool, leading for
more than expected filehandles being created over time. Fix
this by correctly decrementing the count in the case where
something is not yet broken, but is also not yet logged in.
Change-Id: I1b27f9b3b902a253d38293182305cc4dac26b765
When open session fails, console continued trying to use the session
even though it is a lost cause. Correct this by bailing out in time.
Change-Id: Icc09514201c948edf21cf7e9e36f0cfe0520a2c9
When broken for whatever reason, we do not want timeout handling
to continue trying to heal the session. Notably bad when login fails
and a _relog is triggered continually.
Change-Id: Id342a7fc1274fe95483f2e5392b04f86d23c2b1a
When fixing the performance by declining to select() on a socket
until a recvfrom() explictly occurs to clear the socket, a problem
was injected where a socket could be made ignored by particular
timing of incoming traffic on the socket. Correct this by having
the _poller function forcefully return True if any sockets
are ignored (which also implies they are ready since they
should be discarded on read).
Change-Id: I6be39d39e4d2ed3b05af9a4c954fb64c993ffb50
If a session is partially ready to go, but not fully, drop packets.
This can occur if just the right packets drop such that the remote
end gets going but the local end does not receive them.
Change-Id: I63ac506484a1792db673f6e90e13cc4b0132719c
If no keepalives are registered, return cleanly from an
attempt to unregister rather than raise an exception.
Change-Id: I0064714af4ba8f1b62f9061dc0dc481116c871fe
When simulating 80% packet loss, it was discovered that a console
being close() due to inability to complete session establishment
will not have keepaliveid registered yet.
Change-Id: I839645b13cbe30ae71e104c44e63896a4802befe
Session establishment would fail to restart on loss due to deciding to
append to pending payload. Fix by having the establishment phase
reset the payload situation. On logout, the false to retry caused
raw_command to wait forever. Fix by having raw_command not bother
waiting for such things.
Change-Id: I26d2116bf78440b3ccfc319094283c5d7a58cc5e
When select() would identify a a socket, it would
potentially call select() on the same socket
before a recvfrom() would happen. In python 2.7,
this caused the IO thread to block other threads
waiting on something the other threads needed to
do. Resolve by explicitly ignoring a socket
where recvfrom() will be pending until recvfrom()
is next called. This reduces one test case from
42,000-47,000 select() calls to just 86.
Change-Id: Ic8ebecfc61d048e537b5d76a6a3f0665fd340a3d
command would return a number rather than a string for set_bootdev.
Correct this by returning the string passed in on success rather
than the resulting number.
Change-Id: I8e76b1ac9d0222630abe6b160e6271b13ef4987d
This installs the samples as utilities that can be invoked in the path.
With this, some testing and exploration may be made easier.
Change-Id: I5b7ae5b6e30eea3070dfbcb93d23802b8308d281
Since they will not be used on a dead session, remove the reference to
mitigate risk of dead references keeping python from recovering used
memory.
Change-Id: Ib33ea32c02d3cc89b0aa62532e51fc1351e26a79
Some BMCs cannot fetch whole SDRs in one chunk. When faced
with such a scenario, back off exponentially until things can work.
Change-Id: Ifd9df93af56e6fedfeb4d46b662937bf8db80b01
The IPMI layer keepalive is sufficient for most scenarios,
but SOL additionally cares about the SOL payload specifically.
During SOL session, use an SOL specific scheme for keepalive.
Change-Id: I23c5b8da4598696aa936274b3e6b527c8204b4db
A logged out session failed to deregister it's keepalive. As a result, the zombie
keepalive executed and failed. The failure path then corrupts the bmc_handlers structure.
Correct this by both deregistering the erroneous keepalive and having the mark_broken
function be more careful about deleting a member of the class hash that it may have
nothing to do with.
Change-Id: I41251309dc27ffaca89cc7deef9bf16a61f1d07e
If a session was not logged, it would still be considered a candidate for
new session objects. Disqualify such sessions so that new session
objects after a 'logout' or similar will be fulfilled.
Change-Id: I7af11a8a300b7aedcadcec7673d6308e3b08f27d
If the keepalive fails, it was causing the library to spin
on expired keepalive attempts. Call mark_broken in order to
avoid that spinning.
Change-Id: I1c7a06ebf7609989ebd6e90d26ac69f3fe7b8699
Given the nature of SOL, it is impossible to control flow of incoming
traffic. This means measures to mitigate the risk of exhausting buffer
memory on the socket cease to be effective. Modify strategy to stop
throttling and instead allocate new sockets to acquire more network
buffer space. This means the footprint of a small scale setup is
actually even lower and a larger setup does get more filehandles,
but still 1/64th the footprint of the usual strategy.
Change-Id: I10698393d31b0c04d0242ff85815239078c076e2
There are a number of issues flagged by code analysis. None of them
are functional, but change to be happier by code analysis.
Change-Id: Id1c2fb9c32c1f7f45cc7cad77c09fb55fb40a8a3
In the attempt to clean up, one change broke how a command
object knows whether it has an SDR yet or not. Correct that
mistake.
Change-Id: I76faaccf15c2dbfa2b7d5a3a4e1665e0cefe4c6d
Command had a number of awkward style issues stemming from the original
design that was heavy in callbacks. Clean up those issues.
Change-Id: I756e41ac7f909813ce6241f0889a85dd06599b2a
A number of copy/paste structural errors existed. Correct them in
accordance with the specification.
Change-Id: I0984f85811744e3100f5990b0606dfbca98a69d4
There was a problem where the io thread could exist, but not yet
be ready. Fix this by adding an iothreadready bool and a list of
events to fire when iothread is ready.
Change-Id: I4eb13e2210fa07bddbe717f56b12c736c99938dc
IPMI 2.0 rev 1.1 adds support for modeling standby power supplies
and OS installation. Add the appropriate constants.
Change-Id: I60ff394dad5209cedc6030afd740348db79c7f17
Notably, optical was the canonical output but not a recognized input.
'safe' and 'bios' added by request as well.
Change-Id: I061bbc6bce47fcdd2f3b7e9a3d3fb5f74569df15
In certain circumstances, the account desired for use with pyghmi will
be merely operator. Accomodate this without configuration required by
going for admin and then falling back to operator by default. For now
try to go no lower than operator. It would be conceivable to go down
to user, but most everything one would want a service processor for
at that point isn't feasible anyway.
Change-Id: I775aee5db0ca5b8f18bebc2210d342e3d629016d
Go through the IPMI spec and just add as much of table 42-3 as
is reasonable. This should greatly improve usefulness of data
for a wider variety of circumstance.
Change-Id: I05693a609ddeecb49f18d7602403af72565b1a61
Add more information from table 42-3 to the codes understood by pyghmi.
A sensor reporting status on version/revision changes now resolves
to something meaningful.
Change-Id: Ib60b08e2762ece194c0905e4bf840b9a23257360
Previously, pyghmi would incur a KeyError in the event of
something like sensor specific event not in the lookup tables.
Fix this by catching the error and putting in generic description
of state and flagging as 'warning'. This sort of warning suggests
a bug in pyghmi that pyghmi needs to have its event descriptions
updated.
Change-Id: Ia5f4645e30a341a93456dae2b8d75d9fda542e1b
This allows pyghmi to accurately describe events pertaining to event log being
disabled for one reason or another.
Change-Id: Ieebbaa1d836ea115872e4bb6611ff1e9ade6e2c2
Implement sending break over SOL. A BMC may elect
to reply to this with a NACK saying 'break happened',
so have code treat that as 'ACK', since that was after all
the whole intent.
Change-Id: I84c85962fd80901bdef3fa22c3df4936420fb108
This seems to be a wash performance and functionality wise. It does however
mean one less segment of code that incurs an external dependency.
Change-Id: I6691d95172d7d83eae4b4ed1265ba398b220f501
In case of unicode username and password values, just utf-8 encode them.
Here, the encoding shouldn't matter much. All parties must agree
on encoding, but UTF-8 is fine.
Change-Id: Ia4a8a4fcbc5ea9b12ee45ebcc566abe4713b544a
The 'command' variant of raw_command did not recognize the delay_xmit
parameter. When code was changed to go through self instead of through
session, this facet was missed. Fix the problem by adding hook to
pass through that information.
Change-Id: I6c5a13940e753c4300b18500bad60f216e08ad43
When something other than the IO worker thread requests a delay,
there was an interval between pending requests and the new
deadline being calculated during which the non-IO thread would
erroneously consider the old rather than upcoming deadline.
Address by creating a worst case deadline prior to evaluating
pending requests.
Change-Id: Iabde555eb81d2155f4bc4562f0b3a209e1be42a9
If data was sent prior to the activate payload response, the code
to calculate the maximum chunk could not suceed. Correct this
by having sent data accumulate as pending until connected state reached.
Change-Id: I7c9aed67209b3526bd10cafeee0bae6b1b0ab85f
While pyghmi was recording the maximum size the BMC advertised as accepting,
it was not honoring it. Correct this by having the sendpendingpayload function
only send the first 'self.maxoutcount' bytes. This actually turns into a loop
because the ACK coming back for the chunk of data triggers a send of pending
data, which includes the leftovers of the last attempt.
Change-Id: I8e443e08a6eb4ed89eb74412cca92e2138cf9d00
console at least needed the assignment to the session to occur
prior to its callback working. Move the responsibility of the
mandatory loop iteration up a layer so that pyghmi won't break,
but calling code won't have to worry about this either.
Change-Id: I6711acf97574581bb389259563e82e4430bb3f98
Previously, calling code had to manually force an event loop iteration
after making an asynchronous session creation request. Address that
by making a non blocking iteration request happen automatically.
Change-Id: I64f814401cb5ac397ac9ca4a1ae1d434976a2b01
When calling from various threading code strategies, pyghmi
would cause confusion and eventlet to print debug output.
Create a dedicated IO thread to isolate the shared socket
usage from calling code thread behavior. Currently, it still
requires that calling code loop on wait_for_rsp to assure session
liveness and/or to do SOL.
Change-Id: I66164adbfd867200af53269553210a70a0619a85