Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pending fixes mergeprep #27

Open
wants to merge 40 commits into
base: release
Choose a base branch
from
Open

Pending fixes mergeprep #27

wants to merge 40 commits into from

Conversation

Elias481
Copy link
Owner

@Elias481 Elias481 commented May 4, 2019

No description provided.

xaf and others added 30 commits July 29, 2018 01:22
The remove_watch method takes a superficial parameter but never used
it, which made the remove_watch_with_id function set it as False by default.
This fixes that behavior by propagating the parameter.

Signed-off-by: Raphaël Beamonte <[email protected]>
The previous behavior was duplicating a block of code and making
one of the two useless. This fixes that by replacing the constant to
IN_DELETE instead of IN_MOVED_FROM in one of the two blocks.

Signed-off-by: Raphaël Beamonte <[email protected]>
…t happier

 (it still does not like all the dead code..)
add test-case for errno returned in InotifyError, make coverage repor…
Propagate superficial parameter to remove_watch_with_id
Fix constant in adapter to match with DELETE events
…ith_fd] functions

_BaseTree.event_gen(): remove duplicate IN_MOVED_TO, change superficial to False for IN_MOVED_TO
Inotify.remove_watch_with_fd(): as this is a public function it should be possible to call this function without causing inconsitencies which are recoverable only with some dirty try/catch construct... there is also never a need to only remove the wfd from the adaptors list while keeping th path name in list.
 .. now functions remove_watch and remove_watch_with_fd are the same, only difference is parameter eighter pathname or watch-fd
addtionally bot functions now accept a thirst state (None) for superficial - used to skip the "superficial" actions and just remove the wd from inotify (there are use-cases for this, for example with threading to be able to disable wathing from one thread while watching thread get the notification about watch end from inotify an clean up the inotify "superficial").
Utilize travis-ci pip cache for Python 2.6
… by slow)

luckily it pointed me to another bug
…the block from my script that currently need to subclass INotify for different reasons...)
…_FROM/-TO handling, as this branch shall fix all the bugs introduced by that change..)
…g' into fix-remove_watch+_BaseTree.event_gen
…_gen

Fix remove watch+ base tree.event gen (further fixes and testcase for issue 46)
…g' into fix-remove_watch+_BaseTree.event_gen
* still lists are returned and we have to slowly copy them as fast as possible by slicing
* IS_DIR is always the second one so we always have the event on first position and the flag on second
preferrable would be to utilize tuples that wouldn't need to be copied because of their immutability or frozensets which are faster for "'EVENT_NAME' in event_name" expressions in case the possible second one in list is searched for...

(also I personally would prefer to get a fixed length tuple or no nested tuple at all but a boolean is-dir indicator and a string for the eventname... but anyway I prefer to use mask value for performance reasons...)
@coveralls
Copy link

coveralls commented May 4, 2019

Pull Request Test Coverage Report for Build 172

  • 33 of 44 (75.0%) changed or added relevant lines in 4 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.7%) to 85.256%

Changes Missing Coverage Covered Lines Changed/Added Lines %
inotify/calls.py 5 6 83.33%
inotify/adapters.py 20 30 66.67%
Files with Coverage Reduction New Missed Lines %
inotify/adapters.py 1 84.09%
Totals Coverage Status
Change from base Build 104: -0.7%
Covered Lines: 266
Relevant Lines: 312

💛 - Coveralls

Elias Ohm added 3 commits May 4, 2019 13:50
…mes-order

i.e. `:%s/\v\[('IN_ISDIR'), ('IN_\w*')\]/[\2, \1]/g` in test_inotify
include newer python versions up to 3.7 and the different linux versions currently available at travis
… events

that is that some (at least some elder) kernels do not always deliver first the events related to the watchdescriptor itself before the deliver events for the watchdescriptor on parent directory.
this seems to be the case when some pending events for the parent dirs watchdescriptor are to be deliverd at the time the event causing messages on both (the child and parent) occur at the same time. if there is no such thin in queue the events are likely to deliverd in the "correct" or (first for the directly affected child and then for the parent that is notofied about the actions on the child)

this reveals a shortcoming of the current tree-watch logic (which I already had on my list of things to be enhanced) so the test should normally be able to get the events anyway disregarding the order what is not the case currently. to make the tests happy once I just ignore the fact that this shortcoming or bug hasn't been addressed appropriately
@Elias481 Elias481 force-pushed the pending-fixes--mergeprep branch from b53c478 to a87135a Compare May 4, 2019 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants